If you want the server to get rebooted automatically after kernel hit by a pain error message, try adding panic=N to /etc/sysctl.conf file.
It specify kernel behavior on panic. By default, the kernel will not reboot after a panic, but this option will cause a kernel reboot after N seconds. For example following boot parameter will force to reboot Linux after 10 seconds.
Open /etc/sysctl.conf file
# vi /etc/sysctl.conf
When kernel panic's, reboot after 10 second delay
kernel.panic = 10
Save and close the file. Alternatively, you may want to enable and use magic system request keys (SysRq).
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 3 comments… read them below or add one }
Thanks for this tip. My computer had a kernel panic for the first time a couple of weeks ago and I had no choice but to reboot it manually.
One can also add panic=10 to the kernel command line, it will have exactly the same effect.
Of course, it’s possible to change it later with sysctl, or by writing to /proc:
echo 10 > /proc/sys/kernel/panic
Thanks for this tip! As indicated by mangoo: To take this change effect right now, issue the command
sysctl -pto re-read the /etc/sysctl.confOtherwise, this change is not active before the next reboot.