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
0
[[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

Share this

Related Posts

Previous
Next Post »

2 comments

Write comments
Anonymous
June 7, 2012 at 8:54 PM delete

am read many of your articles. Everything is superb.

Thanks for your posts.

--
Linux Srvr Admin

Reply
avatar

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