v2.4.4.5 -> v2.4.4.6
[linux-flexiantxendom0-3.2.10.git] / Documentation / sysrq.txt
1
2                       MAGIC SYSRQ KEY DOCUMENTATION v1.32
3                      ------------------------------------
4                         [Sat Apr  8 22:15:03 CEST 2000]
5
6 *  What is the magic SysRQ key?
7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 It is a 'magical' key combo you can hit which kernel will respond to
9 regardless of whatever else it is doing, unless it is completely locked up.
10
11 *  How do I enable the magic SysRQ key?
12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
14 configuring the kernel. This option is only available in 2.1.x or later
15 kernels. Once you boot the new kernel, you need to enable it manually 
16 using following command:
17
18          echo "1" > /proc/sys/kernel/sysrq
19
20 *  How do I use the magic SysRQ key?
21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 On x86   - You press the key combo 'ALT-SysRQ-<command key>'. Note - Some
23            (older?) may not have a key labeled 'SysRQ'. The 'SysRQ' key is
24            also known as the 'Print Screen' key.
25
26 On SPARC - You press 'ALT-STOP-<command key>', I believe.
27
28 On the serial console (PC style standard serial ports only) -
29            You send a BREAK, then within 5 seconds a command key. Sending
30            BREAK twice is interpreted as a normal BREAK.
31
32 On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,  
33              Print Screen (or F13) - <command key> may suffice.
34
35 On other - If you know of the key combos for other architectures, please
36            let me know so I can add them to this section. 
37
38 *  What are the 'command' keys?
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 'r'     - Turns off keyboard raw mode and sets it to XLATE.
41
42 'k'     - Secure Access Key (SAK) Kills all programs on the current virtual 
43           console. NOTE: See important comments below in SAK section.
44
45 'b'     - Will immediately reboot the system without syncing or unmounting
46           your disks.
47
48 'o'     - Will shut your system off (if configured and supported).
49
50 's'     - Will attempt to sync all mounted filesystems.
51
52 'u'     - Will attempt to remount all mounted filesystems read-only.
53
54 'p'     - Will dump the current registers and flags to your console.
55
56 't'     - Will dump a list of current tasks and their information to your
57           console.
58
59 'm'     - Will dump current memory info to your console.
60
61 '0'-'9' - Sets the console log level, controlling which kernel messages
62           will be printed to your console. ('0', for example would make
63           it so that only emergency messages like PANICs or OOPSes would
64           make it to your console.)
65
66 'e'     - Send a SIGTERM to all processes, except for init.
67
68 'i'     - Send a SIGKILL to all processes, except for init.
69
70 'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
71           will be non-functional after this.)
72
73 'h'     - Will display help ( actually any other key than those listed
74           above will display help. but 'h' is easy to remember :-)
75
76 *  Okay, so what can I use them for?
77 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
79
80 sa'K' (Secure Access Key) is useful when you want to be sure there are no
81 trojan program is running at console and which could grab your password
82 when you would try to login. It will kill all programs on given console
83 and thus letting you make sure that the login prompt you see is actually
84 the one from init, not some trojan program.
85 IMPORTANT:In its true form it is not a true SAK like the one in   :IMPORTANT
86 IMPORTATN:c2 compliant systems, and it should be mistook as such. :IMPORTANT
87         It seems other find it useful as (System Attention Key) which is
88 useful when you want to exit a program that will not let you switch consoles.
89 (For example, X or a svgalib program.)
90
91 re'B'oot is good when you're unable to shut down. But you should also 'S'ync
92 and 'U'mount first.
93
94 'S'ync is great when your system is locked up, it allows you to sync your
95 disks and will certainly lessen the chance of data loss and fscking. Note
96 that the sync hasn't taken place until you see the "OK" and "Done" appear 
97 on the screen. (If the kernel is really in strife, you may not ever get the
98 OK or Done message...)
99
100 'U'mount is basically useful in the same ways as 'S'ync. I generally 'S'ync,
101 'U'mount, then re'B'oot when my system locks. It's saved me many a fsck.
102 Again, the unmount (remount read-only) hasn't taken place until you see the
103 "OK" and "Done" message appear on the screen.
104
105 The loglevel'0'-'9' is useful when your console is being flooded with
106 kernel messages you do not want to see. Setting '0' will prevent all but
107 the most urgent kernel messages from reaching your console. (They will
108 still be logged if syslogd/klogd are alive, though.)
109
110 t'E'rm and k'I'll are useful if you have some sort of runaway process you
111 are unable to kill any other way, especially if it's spawning other
112 processes.
113
114 *  Sometimes SysRQ seems to get 'stuck' after using it, what can I do?
115 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116 That happens to me, also. I've found that tapping shift, alt, and control
117 on both sides of the keyboard, and hitting an invalid sysrq sequence again
118 will fix the problem. (ie, something like alt-sysrq-z). Switching to another
119 virtual console (ALT+Fn) and then back again should also help.
120
121 *  I hit SysRQ, but nothing seems to happen, what's wrong?
122 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123 There are some keyboards that send different scancodes for SysRQ than the
124 pre-defined 0x54. So if SysRQ doesn't work out of the box for a certain 
125 keyboard, run 'showkey -s' to find out the proper scancode sequence. Then 
126 use 'setkeycodes <sequence> 84' to define this sequence to the usual SysRQ 
127 code (84 is decimal for 0x54). It's probably best to put this command in a
128 boot script. Oh, and by the way, you exit 'showkey' by not typing anything 
129 for ten seconds.
130
131 *  I have more questions, who can I ask?
132 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 You may feel free to send email to myrdraal@deathsdoor.com, and I will
134 respond as soon as possible. 
135  -Myrdraal
136
137 *  Credits
138 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139 Written by Mydraal <myrdraal@deathsdoor.com>
140 Updated by Adam Sulmicki <adam@cfar.umd.edu>