Sunday, 6 September 2009

Howto: Automatically reboot on Kernel Panic.

While on holiday I was unable to SSH into my home PC one morning, worrying slightly about what might have happened as the machine is normally rock solid stable I called home to my parents who live very close and asked my mother when she went around to reboot the machine (assuming the house was ok and hadn't burnt down or been burgled)

She called me back up, the lights on the keyboard were flashing and she wasn't sure what to do as there was nothing on the screen when she turned it on, I explained how to hard reset the box (I wasn't going into Raising Skinny Elephants Is Utterly Boring with her), the machine rebooted ok.

After thanking her I logged in and did the tasks I needed to do and then spoke with a friend about it, he made a suggestion I had not known about. The computer could be configured to automatically reboot next time it Kernel paniced. No need to ask my mother to go and reboot it :]

Simply add the following line to /etc/sysctl.conf

kernel.panic = 60

After 60 seconds the computer will automatically reboot itself. Then you need to find out why it paniced and fix it.

No comments: