Kernel Panic Reboot

By default after a kernel panic Linux just sits there and waits for a user to hit the restart button. That can be a bad thing if it’s a remote server.

Checking if enabled

cat /proc/sys/kernel/panic

The returned 0 is the time the kernel will wait before it reboots. If it is 0 or lower, it won’t reboot by itself.

Enabling kernel panic reboot

# echo "5" > /proc/sys/kernel/panic

Where 5 is replaced with the number of seconds to wait till reboot after a kernel panic.

Making it permanent

# echo "kernel.panic=5" >> /etc/sysctl.conf