How to make Linux automatically reboot after a kernel panic

To turn it on, you can set the kernel.panic kernel parameter.

For a running system:

# echo 10 >/proc/sys/kernel/panic

Here, 10 is the number of seconds before the kernel reboots. 0 means the feature is disabled.

To make the configuration persistent, you have 2 choices:

  1. add the kernel parameter panic=10 to your bootloader (grub or grub2).
  2. add kernel.panic = 10 to /etc/sysctl.conf by typing in the terminal sudo nano /etc/sysctl.conf.

After you enabled the auto reboot after kernel panic, you may need to check the uptime and logs or create a @reboot cron jobs to send emails or use some other mechanisms to know that there was a auto reboot caused by a kernel panic.

Credit: https://www.systutorials.com/241433/how-to-make-linux-automatically-reboot-after-a-kernel-panic/

2 thoughts on “How to make Linux automatically reboot after a kernel panic

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s