2006-05-15

So today one of those rare Linux moments happened to me. I was troubleshooting a box with some processes in the uninterruptible wait state and wouldn't die. The box was unable to access mounted network filesystems so I decided to reboot it so I could start troubleshooting from a clean state...only it wouldn't take my shutdown, reboot, or init 6 commands. I *could* have bugged the colo monkeys and requested a reboot, but then I remembered the Magic SysRq key that my manager enlightened me about a couple months ago.

If enabled in the Linux kernel, you can take back control of your system no less than three ways.

1) If you're on the console you can press the magic key sequence ALT-SysRq-[command key] You can look up the different command keys and read more about SysRq here Or if you have the kernel source handy just look for sysrq.c

2) If you are on the console or are connected over the network (such as via ssh) you can also echo the command key characters to /proc/sysrq-trigger (which is what I ended up doing)

3) Marek Zelem wrote an iptables module that even lets you send the magic SysRq command keys over the network. Now that's cool!

No comments: