Automatically rebooting OpenBSD after a panic

Kernel panics don't happen very often, but when they do, on OpenBSD, the default action is to drop into the kernel debugger. Not very handy for servers that are behind locked doors, since they always seem to panic at 3am (or whatever time is least convenient).

Happened to me on Monday, in fact.

A friend pointed me at the ddb docs. "man ddb"

That pointed me to sysctl. "man 8 sysctl"

That pointed me to sysctl.conf "man sysctl.conf"

Hey, I can change ddb.panic from the default of 1 to 0, and instead of dropping to the debugger, the crashlog will be saved and the machine will automagically reboot. Just what I wanted.

And if you change the value manually with the sysctl command, you don't even have to reboot. But remember to change the .conf file so it'll stick.

On FreeBSD it's called debug.debugger_on_panic and there's a similar mechanism.

Handy!

Copyright 2009, Dave Polaschek. Last updated on Mon, 15 Feb 2010 14:09:32.