Reboot Linux box after a kernel panic
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).
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in...
- Practical alternatives to the panic position - when the screen goes blank
- 10 boot time parameters you should know about the Linux kernel
- Ksplice: Patch The Linux Kernel Without Rebooting System
- RHEL / CentOS Support 4GB or more RAM ( memory )
- Howto Reboot or halt Linux system in emergency
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: error message, kernel behavior, kernel panic, kernel.panic, Linux, magic system, reboot, request keys ~ Last updated on: November 16, 2007



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