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:

[root@myserver ~]# cat /proc/sys/kernel/panic
0
[root@myserver ~]# 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.

[root@myserver ~]# echo "10" > /proc/sys/kernel/panic
[root@myserver ~]# 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
June 7, 2012 at 10:54 PM delete

Thanks for visit and feedback..!

Reply
avatar

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