|
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). --- Linux Kernel panic reboot By default after a kernel panic, Linux kernel just waits there for a system administrator to hit the restart or powercycle button. This is because of the value set on "kernel.panic" parameter. [root@linux23 ~]# cat /proc/sys/kernel/panic 0 [root@linux23 ~]# sysctl -a | grep kernel.panic kernel.panic = 0 [root@linux23 ~]# To disable this and make the Linux OS reboot after a kernel panic, we have to set an integer N greater than zero to the paramter "kernel.panic", where "N" is the number of seconds to wait before a automatic reboot. For example , if you set N = 10 , then the system waits for 10 seconds before automatic reboot. To make this permanent, edit /etc/sysctl.conf and set it. [root@linux23 ~]# echo "10" > /proc/sys/kernel/panic 0 [root@linux23 ~]# grep kernel.panic /etc/sysctl.conf kernel.panic = 10 [root@linux23 ~]# This helps in preventing manual intervention after a kernel panic. Setup some kernel dump or netdump to capture the kernel crash debug information. |
|
See Also Have a Linux ProblemLinux Forum - Do you have a Linux Question? Linux Books
Home Index
(c) www.gotothings.com All material on this site is Copyright.
|