FAQ: How to set up atomatic Linux reboot if kernel panic occurs?

180px Forced linux kernel panic under qemuQuestion: How can I get my Linux server rebooted/restarted automatically if it caught a kernel panic?

Answer: As you might know, kernel panic is an action taken by an operating system upon detecting an internal fatal error from which it cannot safely recover; the term is largely specific to Unix and Unix-like systems (it’s a wiki’s description).

By default Linux wouldn’t not reboot after panic occurs, but the following option of sysctl will cause a kernel to reboot after N seconds you specify. In our example server will be rebooted in 15 seconds if kernel panic stopped its operation:

1. Open sysctl’s configuration file:
sudo nano /etc/sysctl.conf

2. Add there the following line:
kernel.panic = 15

or

1. Execute the following command:
/sbin/sysctl -w kernel.panic=15

Hope it helps!

Information improvisation: You can get score highest marks in http:///642-467.htm dumps exam using which are prepared by top certified professionals, http://www.test-king.com/exams/400-051.htm & http://icma.org/ both are marvelous in http://www.actualtests.com/exam-400-051.htm nature.

SHARE:
nv-author-image

Stefan Durand

My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

2 thoughts on “FAQ: How to set up atomatic Linux reboot if kernel panic occurs?”

  1. This tip is very useful if you compile a new kernel remotely, and you want a safe net if something goes wrong; but you must pay attention to not load the same kernel when you startup (so new kernel not on default in lilo/grub ) 🙂

  2. hi I am a newbie using linux can u tell me how to exactly add the line kernel.panic=15 into /etc/sysctl.conf . when I opened /etc/sysctl.conf the cursor points to #. How to add it and using sysctl_p to save it. thank you very much.

Leave a Reply

Your email address will not be published. Required fields are marked *