Changes

Jump to: navigation, search

Magic SysRq Key

90 bytes added, 10:42, 13 June 2006
Reformatted with tables, added several sections and thus TOC
It '''Alt-SysRq-*''' is a '"magical' " key combo you can hit which the kernel will respond to
regardless of whatever else it is doing, unless it is completely locked up.
== /proc/sys/kernel/sysrq == When running a kernel with SysRq compiled in (that's right as in openVZ caseall binary kernels released by OpenVZ),<tt>/proc/sys/kernel/sysrq</tt> file controls the functions allowed to be invoked via the SysRq key.
Here is the list of possible values in <tt>/proc/sys/kernel/sysrq</tt>:<br>
<tt>{| class="wikitable"! 0</tt> - | disable sysrq completely<br><tt>|-! 1</tt> - | enable all functions of sysrq<br>><tt|-! >1</tt> - | bitmask of allowed sysrq functions<br>|}
You can set the value in the file by the following command:
</pre>
== Available keys == To use SysRq feature you should press the key combo 'ALTAlt-SysRq-<command key>'.
The 'SysRq' key is also known as the 'Print Screen' key. Other way, if you don't have
physical access to the node, only ssh, you can do
Here is the list of most useful command keys:
<tt>{| class="wikitable"! b</tt> - | Will immediately reboot re'''b'''oot the system without syncing or unmountingyour disks.<br><tt>|-! s</tt> - | Will attempt to sync '''s'''ync all mounted filesystems.<br><tt>|-! u</tt> - | Will attempt to remount remo'''u'''nt all mounted filesystems read-only.<br><tt>|-! p</tt> - | Will dump dum'''p''' the current registers and flags to your console.<br><tt>|-! t</tt> - | Will dump a list of current tasks '''t'''asks and their information to yourconsoleconsole.<br>|-<tt>! m</tt> - | Will dump current memory '''m'''emory info to your console.<br><tt>|-! 0</tt>-<tt>...9</tt> - | Sets the console log level, controlling which kernel messageswill be printed to your console. ('''0''', for example would makeit so that only emergency messages like PANICs or OOPSes wouldmake it to your console.)<br><tt>|-! f</tt> - | Will call oom_kill to kill a memory hog process<br><tt>|-! e</tt> - | Send a SIGTERM SIGT'''E'''RM to all processes, except for init.<br><tt>|-! i</tt> - | Send a SIGKILL SIGK'''I'''LL to all processes, except for init.<br>|-! h| Will display '''h'''elp|} All output will appear on the console and/or in <tt>h/var/log/messages</tt> - Will display help<br>file.
All ouptput will be on console or in <tt>/var/log/messages</tt>== Example ==
Example of using SysRq. Suppose for some strange reason your system is working slow and you want to
ask developers what happens, then don't forget to press
<tt>altAlt-sysrqSysRq-p</tt> and <tt>altAlt-sysrqSysRq-t</tt> several times,
and attach <tt>/var/log/messages</tt> to request.
[[Category: Troubleshooting]]
[[Category: Kernel]]

Navigation menu