--- Documentation/sysrq.txt.old Sun Mar 19 19:38:43 2000 +++ Documentation/sysrq.txt Sun Mar 19 20:20:48 2000 @@ -1,7 +1,7 @@ - MAGIC SYSRQ KEY DOCUMENTATION v1.31 + MAGIC SYSRQ KEY DOCUMENTATION v1.32 ------------------------------------ - [Mon Mar 13 21:45:48 EST 2000] + [Sun Mar 19 20:20:48 PST 2000] * What is the magic SysRQ key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -12,58 +12,63 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when configuring the kernel. This option is only available in 2.1.x or later -kernels. Once you boot the new kernel, you need to enable it manually -using following command: +kernels. Once you boot the new kernel it is enabled by default. You need to +disable it manually using following command if you do not want sysrq +functionality: - echo "1" > /proc/sys/kernel/sysrq +To disable: + echo "0" > /proc/sys/kernel/sysrq + +To enable: + echo "1" > /proc/sys/kernel/sysrq * How do I use the magic SysRQ key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -On x86 - You press the key combo 'ALT-SysRQ-'. Note - Some - (older?) may not have a key labeled 'SysRQ'. The 'SysRQ' key is - also known as the 'Print Screen' key. +On x86 - You press the key combo 'ALT-SysRQ-'. Note - Some + (older?) may not have a key labeled 'SysRQ'. The 'SysRQ' key is + also known as the 'Print Screen' key. -On SPARC - You press 'ALT-STOP-', I believe. +On SPARC - You press 'ALT-STOP-', I believe. -On other - If you know of the key combos for other architectures, please - let me know so I can add them to this section. +On other - If you know of the key combos for other architectures, please + let me know so I can add them to this section. * What are the 'command' keys? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -'r' - Turns off keyboard raw mode and sets it to XLATE. +'r' - Turns off keyboard raw mode and sets it to XLATE. -'k' - Secure Access Key (SAK) Kills all programs on the current virtual +'k' - Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section. -'b' - Will immediately reboot the system without syncing or unmounting - your disks. +'b' - Will immediately reboot the system without syncing or unmounting + your disks. -'o' - Will shut your system off (if configured and supported). +'o' - Will shut your system off (if configured and supported). -'s' - Will attempt to sync all mounted filesystems. +'s' - Will attempt to sync all mounted filesystems. -'u' - Will attempt to remount all mounted filesystems read-only. +'u' - Will attempt to remount all mounted filesystems read-only. -'p' - Will dump the current registers and flags to your console. +'p' - Will dump the current registers and flags to your console. -'t' - Will dump a list of current tasks and their information to your - console. +'t' - Will dump a list of current tasks and their information to your + console. -'m' - Will dump current memory info to your console. +'m' - Will dump current memory info to your console. -'0'-'9' - Sets the console log level, controlling which kernel messages - will be printed to your console. ('0', for example would make - it so that only emergency messages like PANICs or OOPSes would - make it to your console.) +'0'-'9' - Sets the console log level, controlling which kernel messages + will be printed to your console. ('0', for example would make + it so that only emergency messages like PANICs or OOPSes would + make it to your console.) -'e' - Send a SIGTERM to all processes, except for init. +'e' - Send a SIGTERM to all processes, except for init. -'i' - Send a SIGKILL to all processes, except for init. +'i' - Send a SIGKILL to all processes, except for init. -'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system - will be non-functional after this.) +'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system + will be non-functional after this.) -'h' - Will display help ( actually any other key than those listed +'h' - Will display help (actually any other key than those listed above will display help. but 'h' is easy to remember :-) * Okay, so what can I use them for? @@ -71,34 +76,39 @@ Well, un'R'aw is very handy when your X server or a svgalib program crashes. sa'K' (Secure Access Key) is usefull when you want to be sure there are no -trojan program is running at console and which could grab your password -when you would try to login. It will kill all programs on given console -and thus letting you make sure that the login prompt you see is actually -the one from init, not some trojan program. -IMPORTANT:In its true form it is not a true SAK like the one in :IMPORTANT -IMPORTATN:c2 compliant systems, and it should be mistook as such. :IMPORTANT - It seems other find it usefull as (System Attention Key) which is -useful when you want to exit a program that will not let you switch consoles. -(For example, X or a svgalib program.) +trojan programs running on your console which could grab your password when +you would try to login. It will kill all programs on your given console and +thus letting you make sure that the login prompt you see is actually the one +from init, not some trojan program. + +IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT + In its true form it is not a true SAK like the one in c2 compliant systems, + and it should be mistaken as such nor does it ensure a security from a + kernel module trojan intercepting an init child. +IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT + + It seems others find it useful as (System Attention Key) which is useful +when you want to exit a program that will not let you switch consoles. (For +example, X or a svgalib program.) re'B'oot is good when you're unable to shut down. But you should also 'S'ync and 'U'mount first. 'S'ync is great when your system is locked up, it allows you to sync your disks and will certainly lessen the chance of data loss and fscking. Note -that the sync hasn't taken place until you see the "OK" and "Done" appear -on the screen. (If the kernel is really in strife, you may not ever get the -OK or Done message...) +that the sync hasn't taken place until you see the "OK" and "Done" appear on +the screen. (If the kernel is really in strife, you may not ever get the OK +or Done message...) 'U'mount is basically useful in the same ways as 'S'ync. I generally 'S'ync, 'U'mount, then re'B'oot when my system locks. It's saved me many a fsck. Again, the unmount (remount read-only) hasn't taken place until you see the "OK" and "Done" message appear on the screen. -The loglevel'0'-'9' is useful when your console is being flooded with -kernel messages you do not want to see. Setting '0' will prevent all but -the most urgent kernel messages from reaching your console. (They will -still be logged if syslogd/klogd are alive, though.) +The loglevel'0'-'9' is useful when your console is being flooded with kernel +messages you do not want to see. Setting '0' will prevent all but the most +urgent kernel messages from reaching your console. (They will still be +logged if syslogd/klogd are alive though.) t'E'rm and k'I'll are useful if you have some sort of runaway process you are unable to kill any other way, especially if it's spawning other @@ -106,28 +116,29 @@ * Sometimes SysRQ seems to get 'stuck' after using it, what can I do? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -That happens to me, also. I've found that tapping shift, alt, and control -on both sides of the keyboard, and hitting an invalid sysrq sequence again -will fix the problem. (ie, something like alt-sysrq-z). Switching to another +That happens to me, also. I've found that tapping shift, alt, and control on +both sides of the keyboard, and hitting an invalid sysrq sequence again will +fix the problem. (ie, something like alt-sysrq-z). Switching to another virtual console (ALT+Fn) and then back again should also help. * I hit SysRQ, but nothing seems to happen, what's wrong? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are some keyboards which do not support 'SysRQ', you can try running -'showkey -s' and pressing SysRQ or alt-SysRQ to see if it generates any -0x54 codes. If it doesn't, you may define the magic sysrq sequence to a -different key. Find the keycode with showkey, and change the define of -'#define SYSRQ_KEY 0x54' in [/usr/src/linux/]include/asm/keyboard.h to -the keycode of the key you wish to use, then recompile. Oh, and by the way, -you exit 'showkey' by not typing anything for ten seconds. +'showkey -s' and pressing SysRQ or alt-SysRQ to see if it generates any 0x54 +codes. If it doesn't, you may define the magic sysrq sequence to a different +key. Find the keycode with showkey, and change the define of '#define +SYSRQ_KEY 0x54' in [/usr/src/linux/]include/asm/keyboard.h to the keycode of +the key you wish to use, then recompile. Oh, and by the way, you exit +'showkey' by not typing anything for ten seconds. * I have more questions, who can I ask? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You may feel free to send email to myrdraal@deathsdoor.com, and I will -respond as soon as possible. +respond as soon as possible. -Myrdraal * Credits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Written by Mydraal Updated by Adam Sulmicki +Updated by David Ford