Linux has the "magic sysrq key" to reboot frozen machines remotely, and it works over the serial console, but what about FreeBSD? Is there a way to send a "control-alt-delete" to FreeBSD servers on serial consoles?
1 Answer
Assuming you have a kernel with the debugger option compiled in you can use ControlAltEscape. From there you can call boot(0)
or panic
.
Chapter 10 of the FreeBSD developers handbook explains this in a lot more detail.
So much for more or less the same as SysReq via a keyboard. On the serial console, you need to send the break signal and have the options BREAK_TO_DEBUGGER
enabled. But "it is not the default since there are a lot of serial adapters around that gratuitously generate a BREAK condition, for example when pulling the cable".
-
chapter 10 of the freebsd handbook is about printing, did you mean chapter 10 of the developers handbook?– anarcatOct 26, 2013 at 21:58
-
Aye. I did. I was linking to both the normal handbook and the lin you posted, then I cleaned it up. I guess I got sidetracked during that. Thanks for noticing.– HennesOct 27, 2013 at 16:52
-
so i tried it, and it doesn't work from the serial console, it seems that you need to send a BREAK and have the
options BREAK_TO_DEBUGGER
in your kernel config.– anarcatOct 29, 2013 at 15:31 -
These day, you can also control the state of support for breaking into the kernel debugger with
sysctl
- thedebug.kdb.break_to_debugger
setting. There is also an alternate key sequence that is handy when your console connection does not support the serial break condition. See thedebug.kdb.alt_break_to_debugger
sysctl setting oroptions ALT_BREAK_TO_DEBUGGER
in the kernel config. See alsoddb(4)
andgdb(4)
. The alt break method supports key sequences to enter the debugger, perform an immediate reboot, or generate a panic.– JuanMar 12 at 14:33