Import 2.3.11pre1
[davej-history.git] / Documentation / sysrq.txt
blob40bce4fd7ccf5ec72fc842165647a60271f008a1
1                       MAGIC SYSRQ KEY DOCUMENTATION v1.2
2                      ------------------------------------
3                         [Sat May 16 01:09:21 EDT 1998]
5 *  What is the magic SysRQ key?
6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 It is a 'magical' key combo you can hit which kernel will respond to
8 regardless of whatever else it is doing, unless it is completely locked up.
10 *  How do I enable the magic SysRQ key?
11 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 You need to say yes to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
13 configuring the kernel. This option is only available it 2.1.x or later
14 kernels.
16 *  How do I use the magic SysRQ key?
17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 On x86   - You press the key combo 'ALT-SysRQ-<command key>'. Note - Some
19            (older?) may not have a key labeled 'SysRQ'. The 'SysRQ' key is
20            also known as the 'Print Screen' key.
22 On SPARC - You press 'ALT-STOP-<command key>', I believe.
24 On other - If you know of the key combos for other architectures, please
25            let me know so I can add them to this section. 
27 *  What are the 'command' keys?
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 'r'     - Turns off keyboard raw mode and sets it to XLATE.
31 'k'     - Kills all programs on the current virtual console.
33 'b'     - Will immediately reboot the system without syncing or unmounting
34           your disks.
36 'o'     - Will shut your system off via APM (if configured and supported).
38 's'     - Will attempt to sync all mounted filesystems.
40 'u'     - Will attempt to remount all mounted filesystems read-only.
42 'p'     - Will dump the current registers and flags to your console.
44 't'     - Will dump a list of current tasks and their information to your
45           console.
47 'm'     - Will dump current memory info to your console.
49 '0'-'9' - Sets the console log level, controlling which kernel messages
50           will be printed to your console. ('0', for example would make
51           it so that only emergency messages like PANICs or OOPSes would
52           make it to your console.)
54 'e'     - Send a SIGTERM to all processes, except for init.
56 'i'     - Send a SIGKILL to all processes, except for init.
58 'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
59           will be non-functional after this.)
61 *  Okay, so what can I use them for?
62 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
65 sa'K' (system attention key) is useful when you want to exit a program
66 that will not let you switch consoles. (For example, X or a svgalib program.)
68 re'B'oot is good when you're unable to shut down. But you should also 'S'ync
69 and 'U'mount first.
71 'S'ync is great when your system is locked up, it allows you to sync your
72 disks and will certainly lessen the chance of data loss and fscking. Note
73 that the sync hasn't taken place until you see the "OK" and "Done" appear 
74 on the screen. (If the kernel is really in strife, you may not ever get the
75 OK or Done message...)
77 'U'mount is basically useful in the same ways as 'S'ync. I generally 'S'ync,
78 'U'mount, then re'B'oot when my system locks. It's saved me many a fsck.
79 Again, the unmount (remount read-only) hasn't taken place until you see the
80 "OK" and "Done" message appear on the screen.
82 The loglevel'0'-'9' is useful when your console is being flooded with
83 kernel messages you do not want to see. Setting '0' will prevent all but
84 the most urgent kernel messages from reaching your console. (They will
85 still be logged if syslogd/klogd are alive, though.)
87 t'E'rm and k'I'll are useful if you have some sort of runaway process you
88 are unable to kill any other way, especially if it's spawning other
89 processes.
91 *  Sometimes SysRQ seems to get 'stuck' after using it, what can I do?
92 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93 That happens to me, also. I've found that tapping shift, alt, and control
94 on both sides of the keyboard, and hitting an invalid sysrq sequence again
95 will fix the problem. (ie, something like alt-sysrq-z). Switching to another
96 virtual console (ALT+Fn) and then back again should also help.
98 *  I hit SysRQ, but nothing seems to happen, what's wrong?
99 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100 There are some keyboards which do not support 'SysRQ', you can try running
101 'showkey -s' and pressing SysRQ or alt-SysRQ to see if it generates any
102 0x54 codes. If it doesn't, you may define the magic sysrq sequence to a
103 different key. Find the keycode with showkey, and change the define of
104 '#define SYSRQ_KEY 0x54' in [/usr/src/linux/]include/asm/keyboard.h to
105 the keycode of the key you wish to use, then recompile. Oh, and by the way,
106 you exit 'showkey' by not typing anything for ten seconds.
108 *  I have more questions, who can I ask?
109 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110 You may feel free to send email to myrdraal@deathsdoor.com, and I will
111 respond as soon as possible. If that email address does not work, use
112 myrdraal@jackalz.dyn.ml.org.
113  -Myrdraal