Search:  
Gentoo Wiki

TIP_Kernel_Panic_Reboot

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

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

To check if its enabled try this:

Code: cat /proc/sys/kernel/panic
0

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

To set the kernel to reboot do this command:

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

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

To check the time was set right do this:

Code: cat /proc/sys/kernel/panic
5

Making it permanent

To make it more permanent do this:

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

Adding the following to your kernel parameters in your bootloaders configuration might also help:

panic=5

NOTE: Substitute 5 with the number of seconds to wait till reboot after a kernel panic.

Retrieved from "http://www.gentoo-wiki.info/TIP_Kernel_Panic_Reboot"

Last modified: Thu, 12 Jun 2008 09:48:00 +0000 Hits: 28,507