Sharing Knowledge | System Admin Articles

Automatic reboot after Kernel Panic in Linux

In Linux, By default after kernel panic, Linux waits for a system admin to restart or power cycle server.. We can change this behavior and set to reboot automatically when a kernel panic occurs.. For that, we have to change the value set on "kernel.panic" kernel parameter.

Now we have to check the current value on this kernel parameter in Linux server:

[[email protected] ~]# cat /proc/sys/kernel/panic
[[email protected] ~]# sysctl -a | grep kernel.panic
kernel.panic = 0

To make the Linux server automatically reboot after a kernel panic, we have to set a value greater than 0. The value should be the number of seconds to wait before automatic reboot of the server. 

For example , if you set value 60 , then the server will wait for 60 seconds before automatic reboot after the kernel panic. To make this change permanent, edit /etc/sysctl.conf and set it there.

[[email protected] ~]# echo "10" > /proc/sys/kernel/panic
[[email protected] ~]# cat /etc/sysctl.conf |  grep kernel.panic 
kernel.panic = 10

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

2 Comments for "Automatic reboot after Kernel Panic in Linux"

am read many of your articles. Everything is superb.

Thanks for your posts.

Linux Srvr Admin

What do you think about this Article? Add your Opinion..!

Back To Top