sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget%/translations/zh_CN/admin-guide/sysrqmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/zh_TW/admin-guide/sysrqmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/it_IT/admin-guide/sysrqmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ja_JP/admin-guide/sysrqmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ko_KR/admin-guide/sysrqmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/sp_SP/admin-guide/sysrqmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h$Linux Magic System Request Key Hacksh]h$Linux Magic System Request Key Hacks}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh?/var/lib/git/docbuild/linux/Documentation/admin-guide/sysrq.rsthKubh paragraph)}(hDocumentation for sysrq.ch]hDocumentation for sysrq.c}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hWhat is the magic SysRq key?h]hWhat is the magic SysRq key?}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hIt 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.h]hIt 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.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubeh}(h]what-is-the-magic-sysrq-keyah ]h"]what is the magic sysrq key?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h$How do I enable the magic SysRq key?h]h$How do I enable the magic SysRq key?}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hXYou need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when configuring the kernel. When running a kernel with SysRq compiled in, /proc/sys/kernel/sysrq controls the functions allowed to be invoked via the SysRq key. The default value in this file is set by the CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:h]hXYou need to say “yes” to ‘Magic SysRq key (CONFIG_MAGIC_SYSRQ)’ when configuring the kernel. When running a kernel with SysRq compiled in, /proc/sys/kernel/sysrq controls the functions allowed to be invoked via the SysRq key. The default value in this file is set by the CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hXI- 0 - disable sysrq completely - 1 - enable all functions of sysrq - >1 - bitmask of allowed sysrq functions (see below for detailed function description):: 2 = 0x2 - enable control of console logging level 4 = 0x4 - enable control of keyboard (SAK, unraw) 8 = 0x8 - enable debugging dumps of processes etc. 16 = 0x10 - enable sync command 32 = 0x20 - enable remount read-only 64 = 0x40 - enable signalling of processes (term, kill, oom-kill) 128 = 0x80 - allow reboot/poweroff 256 = 0x100 - allow nicing of all RT tasks h]h bullet_list)}(hhh](h list_item)}(h0 - disable sysrq completelyh]h)}(hjh]h0 - disable sysrq completely}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h!1 - enable all functions of sysrqh]h)}(hj3h]h!1 - enable all functions of sysrq}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hX>1 - bitmask of allowed sysrq functions (see below for detailed function description):: 2 = 0x2 - enable control of console logging level 4 = 0x4 - enable control of keyboard (SAK, unraw) 8 = 0x8 - enable debugging dumps of processes etc. 16 = 0x10 - enable sync command 32 = 0x20 - enable remount read-only 64 = 0x40 - enable signalling of processes (term, kill, oom-kill) 128 = 0x80 - allow reboot/poweroff 256 = 0x100 - allow nicing of all RT tasks h](h)}(hW>1 - bitmask of allowed sysrq functions (see below for detailed function description)::h]hV>1 - bitmask of allowed sysrq functions (see below for detailed function description):}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHubh literal_block)}(hX~ 2 = 0x2 - enable control of console logging level 4 = 0x4 - enable control of keyboard (SAK, unraw) 8 = 0x8 - enable debugging dumps of processes etc. 16 = 0x10 - enable sync command 32 = 0x20 - enable remount read-only 64 = 0x40 - enable signalling of processes (term, kill, oom-kill) 128 = 0x80 - allow reboot/poweroff 256 = 0x100 - allow nicing of all RT tasksh]hX~ 2 = 0x2 - enable control of console logging level 4 = 0x4 - enable control of keyboard (SAK, unraw) 8 = 0x8 - enable debugging dumps of processes etc. 16 = 0x10 - enable sync command 32 = 0x20 - enable remount read-only 64 = 0x40 - enable signalling of processes (term, kill, oom-kill) 128 = 0x80 - allow reboot/poweroff 256 = 0x100 - allow nicing of all RT tasks}hj\sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jZhhhKhjHubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1j hhhKhhhhubh)}(h/proc/sys/kernel/sysrqh]h%echo "number" >/proc/sys/kernel/sysrq}hjsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhK&hhhhubh)}(hThe number may be written here either as decimal or as hexadecimal with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be written in hexadecimal.h]hThe number may be written here either as decimal or as hexadecimal with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be written in hexadecimal.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hhhhubh)}(hNote that the value of ``/proc/sys/kernel/sysrq`` influences only the invocation via a keyboard. Invocation of any operation via ``/proc/sysrq-trigger`` is always allowed (by a user with admin privileges).h](hNote that the value of }(hjhhhNhNubhliteral)}(h``/proc/sys/kernel/sysrq``h]h/proc/sys/kernel/sysrq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhP influences only the invocation via a keyboard. Invocation of any operation via }(hjhhhNhNubj)}(h``/proc/sysrq-trigger``h]h/proc/sysrq-trigger}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh5 is always allowed (by a user with admin privileges).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK,hhhhubeh}(h]#how-do-i-enable-the-magic-sysrq-keyah ]h"]$how do i enable the magic sysrq key?ah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h!How do I use the magic SysRq key?h]h!How do I use the magic SysRq key?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK1ubhdefinition_list)}(hhh](hdefinition_list_item)}(hXOn x86 You press the key combo `ALT-SysRq-`. .. note:: Some keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is also known as the 'Print Screen' key. Also some keyboards cannot handle so many keys being pressed at the same time, so you might have better luck with press `Alt`, press `SysRq`, release `SysRq`, press ``, release everything. h](hterm)}(hOn x86h]hOn x86}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK`.h](hYou press the key combo }(hjhhhNhNubhtitle_reference)}(h`ALT-SysRq-`h]hALT-SysRq-}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK4hjubhnote)}(hX5Some keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is also known as the 'Print Screen' key. Also some keyboards cannot handle so many keys being pressed at the same time, so you might have better luck with press `Alt`, press `SysRq`, release `SysRq`, press ``, release everything.h]h)}(hX5Some keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is also known as the 'Print Screen' key. Also some keyboards cannot handle so many keys being pressed at the same time, so you might have better luck with press `Alt`, press `SysRq`, release `SysRq`, press ``, release everything.h](hSome keyboards may not have a key labeled ‘SysRq’. The ‘SysRq’ key is also known as the ‘Print Screen’ key. Also some keyboards cannot handle so many keys being pressed at the same time, so you might have better luck with press }(hj?hhhNhNubj )}(h`Alt`h]hAlt}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh, press }(hj?hhhNhNubj )}(h`SysRq`h]hSysRq}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh , release }(hj?hhhNhNubj )}(h`SysRq`h]hSysRq}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh, press }hj?sbj )}(h``h]h }(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh, release everything.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK7hj;ubah}(h]h ]h"]h$]h&]uh1j9hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK`, I believe. h](j)}(hOn SPARCh]hOn SPARC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK?hjubj)}(hhh]h)}(h.You press `ALT-STOP-`, I believe.h](h You press }(hjhhhNhNubj )}(h`ALT-STOP-`h]hALT-STOP-}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh , I believe.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK?hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK?hjhhubj)}(hOn the serial console (PC style standard serial ports only) You send a ``BREAK``, then within 5 seconds a command key. Sending ``BREAK`` twice is interpreted as a normal BREAK. h](j)}(h;On the serial console (PC style standard serial ports only)h]h;On the serial console (PC style standard serial ports only)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKChjubj)}(hhh]h)}(htYou send a ``BREAK``, then within 5 seconds a command key. Sending ``BREAK`` twice is interpreted as a normal BREAK.h](h You send a }(hjhhhNhNubj)}(h ``BREAK``h]hBREAK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh/, then within 5 seconds a command key. Sending }(hjhhhNhNubj)}(h ``BREAK``h]hBREAK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( twice is interpreted as a normal BREAK.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKBhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKChjhhubj)}(h}On PowerPC Press `ALT - Print Screen` (or `F13`) - ``. `Print Screen` (or `F13`) - `` may suffice. h](j)}(h On PowerPCh]h On PowerPC}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKGhj;ubj)}(hhh]h)}(hqPress `ALT - Print Screen` (or `F13`) - ``. `Print Screen` (or `F13`) - `` may suffice.h](hPress }(hjPhhhNhNubj )}(h`ALT - Print Screen`h]hALT - Print Screen}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh (or }(hjPhhhNhNubj )}(h`F13`h]hF13}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh) - }(hjPhhhNhNubj )}(h``h]h }(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh. }(hjPhhhNhNubj )}(h`Print Screen`h]h Print Screen}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh (or }hjPsbj )}(h`F13`h]hF13}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh) - }hjPsbj )}(h``h]h }(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubh may suffice.}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKFhjMubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhhhKGhjhhubj)}(hvOn other If you know of the key combos for other architectures, please submit a patch to be included in this section. h](j)}(hOn otherh]hOn other}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKKhjubj)}(hhh]h)}(hlIf you know of the key combos for other architectures, please submit a patch to be included in this section.h]hlIf you know of the key combos for other architectures, please submit a patch to be included in this section.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKKhjhhubj)}(hXOn all Write a single character to /proc/sysrq-trigger. Only the first character is processed, the rest of the string is ignored. However, it is not recommended to write any extra characters as the behavior is undefined and might change in the future versions. E.g.:: echo t > /proc/sysrq-trigger Alternatively, write multiple characters prepended by underscore. This way, all characters will be processed. E.g.:: echo _reisub > /proc/sysrq-trigger h](j)}(hOn allh]hOn all}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKYhjubj)}(hhh](h)}(hXWrite a single character to /proc/sysrq-trigger. Only the first character is processed, the rest of the string is ignored. However, it is not recommended to write any extra characters as the behavior is undefined and might change in the future versions. E.g.::h]hXWrite a single character to /proc/sysrq-trigger. Only the first character is processed, the rest of the string is ignored. However, it is not recommended to write any extra characters as the behavior is undefined and might change in the future versions. E.g.:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubj[)}(hecho t > /proc/sysrq-triggerh]hecho t > /proc/sysrq-trigger}hj(sbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhKThjubh)}(htAlternatively, write multiple characters prepended by underscore. This way, all characters will be processed. E.g.::h]hsAlternatively, write multiple characters prepended by underscore. This way, all characters will be processed. E.g.:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjubj[)}(h"echo _reisub > /proc/sysrq-triggerh]h"echo _reisub > /proc/sysrq-trigger}hjDsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhKYhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKYhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhNhNubh)}(h&The `` is case sensitive.h](hThe }(hjdhhhNhNubj )}(h``h]h }(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjdubh is case sensitive.}(hjdhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjhhubeh}(h] how-do-i-use-the-magic-sysrq-keyah ]h"]!how do i use the magic sysrq key?ah$]h&]uh1hhhhhhhhK1ubh)}(hhh](h)}(hWhat are the 'command' keys?h]h What are the ‘command’ keys?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK^ubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKCuh1jhjubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(hCommandh]hCommand}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hFunctionh]hFunction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubhtbody)}(hhh](j)}(hhh](j)}(hhh]h)}(h``b``h]j)}(hjh]hb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKchj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hLWill immediately reboot the system without syncing or unmounting your disks.h]hLWill immediately reboot the system without syncing or unmounting your disks.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``c``h]j)}(hjPh]hc}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjKubah}(h]h ]h"]h$]h&]uh1jhjHubj)}(hhh]h)}(hHWill perform a system crash and a crashdump will be taken if configured.h]hHWill perform a system crash and a crashdump will be taken if configured.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjkubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``d``h]j)}(hjh]hd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKihjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hShows all locks that are held.h]hShows all locks that are held.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``e``h]j)}(hjh]he}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKkhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h1Send a SIGTERM to all processes, except for init.h]h1Send a SIGTERM to all processes, except for init.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``f``h]j)}(hjh]hf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKmhj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(haWill call the oom killer to kill a memory hog process, but do not panic if nothing can be killed.h]haWill call the oom killer to kill a memory hog process, but do not panic if nothing can be killed.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``g``h]j)}(hjPh]hg}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubah}(h]h ]h"]h$]h&]uh1hhhhKphjKubah}(h]h ]h"]h$]h&]uh1jhjHubj)}(hhh]h)}(hUsed by kgdb (kernel debugger)h]hUsed by kgdb (kernel debugger)}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjkubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``h``h]j)}(hjh]hh}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(huWill display help (actually any other key than those listed here will display help. but ``h`` is easy to remember :-)h](hXWill display help (actually any other key than those listed here will display help. but }(hjhhhNhNubj)}(h``h``h]hh}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is easy to remember :-)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``i``h]j)}(hjh]hi}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKuhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h1Send a SIGKILL to all processes, except for init.h]h1Send a SIGKILL to all processes, except for init.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``j``h]j)}(hj"h]hj}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hCForcibly "Just thaw it" - filesystems frozen by the FIFREEZE ioctl.h]hGForcibly “Just thaw it” - filesystems frozen by the FIFREEZE ioctl.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj=ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``k``h]j)}(hjbh]hk}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]uh1hhhhKyhj]ubah}(h]h ]h"]h$]h&]uh1jhjZubj)}(hhh]h)}(h}Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.h]h}Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhj}ubah}(h]h ]h"]h$]h&]uh1jhjZubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``l``h]j)}(hjh]hl}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h,Shows a stack backtrace for all active CPUs.h]h,Shows a stack backtrace for all active CPUs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``m``h]j)}(hjh]hm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h.Will dump current memory info to your console.h]h.Will dump current memory info to your console.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``n``h]j)}(hj"h]hn}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hUsed to make RT tasks nice-ableh]hUsed to make RT tasks nice-able}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj=ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``o``h]j)}(hjbh]ho}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]uh1hhhhKhj]ubah}(h]h ]h"]h$]h&]uh1jhjZubj)}(hhh]h)}(h8Will shut your system off (if configured and supported).h]h8Will shut your system off (if configured and supported).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}ubah}(h]h ]h"]h$]h&]uh1jhjZubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``p``h]j)}(hjh]hp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h:Will dump the current registers and flags to your console.h]h:Will dump the current registers and flags to your console.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``q``h]j)}(hjh]hq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hWill dump per CPU lists of all armed hrtimers (but NOT regular timer_list timers) and detailed information about all clockevent devices.h]hWill dump per CPU lists of all armed hrtimers (but NOT regular timer_list timers) and detailed information about all clockevent devices.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``r``h]j)}(hj" h]hr}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h1Turns off keyboard raw mode and sets it to XLATE.h]h1Turns off keyboard raw mode and sets it to XLATE.}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``s``h]j)}(hjb h]hs}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj` ubah}(h]h ]h"]h$]h&]uh1hhhhKhj] ubah}(h]h ]h"]h$]h&]uh1jhjZ ubj)}(hhh]h)}(h-Will attempt to sync all mounted filesystems.h]h-Will attempt to sync all mounted filesystems.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj} ubah}(h]h ]h"]h$]h&]uh1jhjZ ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``t``h]j)}(hj h]ht}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hHWill dump a list of current tasks and their information to your console.h]hHWill dump a list of current tasks and their information to your console.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``u``h]j)}(hj h]hu}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h:Will attempt to remount all mounted filesystems read-only.h]h:Will attempt to remount all mounted filesystems read-only.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``v``h]j)}(hj" h]hv}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h'Forcefully restores framebuffer consoleh]h'Forcefully restores framebuffer console}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``v``h]j)}(hjb h]hv}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj` ubah}(h]h ]h"]h$]h&]uh1hhhhKhj] ubah}(h]h ]h"]h$]h&]uh1jhjZ ubj)}(hhh]h)}(h%Causes ETM buffer dump [ARM-specific]h]h%Causes ETM buffer dump [ARM-specific]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj} ubah}(h]h ]h"]h$]h&]uh1jhjZ ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``w``h]j)}(hj h]hw}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h8Dumps tasks that are in uninterruptible (blocked) state.h]h8Dumps tasks that are in uninterruptible (blocked) state.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``x``h]j)}(hj h]hx}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(htUsed by xmon interface on ppc/powerpc platforms. Show global PMU Registers on sparc64. Dump all TLB entries on MIPS.h]htUsed by xmon interface on ppc/powerpc platforms. Show global PMU Registers on sparc64. Dump all TLB entries on MIPS.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``y``h]j)}(hj" h]hy}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h-Show global CPU Registers [SPARC-64 specific]h]h-Show global CPU Registers [SPARC-64 specific]}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj= ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``z``h]j)}(hjb h]hz}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj` ubah}(h]h ]h"]h$]h&]uh1hhhhKhj] ubah}(h]h ]h"]h$]h&]uh1jhjZ ubj)}(hhh]h)}(hDump the ftrace bufferh]hDump the ftrace buffer}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj} ubah}(h]h ]h"]h$]h&]uh1jhjZ ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h ``0``-``9``h](j)}(h``0``h]h0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh-}(hj hhhNhNubj)}(h``9``h]h9}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hSets 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.)h](h`Sets the console log level, controlling which kernel messages will be printed to your console. (}(hj hhhNhNubj)}(h``0``h]h0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhq, for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``R``h]j)}(hj h]hR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(h+Replay the kernel log messages on consoles.h]h+Replay the kernel log messages on consoles.}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj" ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]what-are-the-command-keysah ]h"]what are the 'command' keys?ah$]h&]uh1hhhhhhhhK^ubh)}(hhh](h)}(h!Okay, so what can I use them for?h]h!Okay, so what can I use them for?}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZ hhhhhKubh)}(hMWell, unraw(r) is very handy when your X server or a svgalib program crashes.h]hMWell, unraw(r) is very handy when your X server or a svgalib program crashes.}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(hXDsak(k) (Secure Access Key) is useful when you want to be sure there is no trojan program running at console which could grab your password when you would try to login. It will kill all programs on given console, thus letting you make sure that the login prompt you see is actually the one from init, not some trojan program.h]hXDsak(k) (Secure Access Key) is useful when you want to be sure there is no trojan program running at console which could grab your password when you would try to login. It will kill all programs on given console, thus letting you make sure that the login prompt you see is actually the one from init, not some trojan program.}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh important)}(hsIn its true form it is not a true SAK like the one in a c2 compliant system, and it should not be mistaken as such.h]h)}(hsIn its true form it is not a true SAK like the one in a c2 compliant system, and it should not be mistaken as such.h]hsIn its true form it is not a true SAK like the one in a c2 compliant system, and it should not be mistaken as such.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hjZ hhhhhNubh)}(hIt 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.)h]hIt 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.)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(hj``reboot(b)`` is good when you're unable to shut down, it is an equivalent of pressing the "reset" button.h](j)}(h ``reboot(b)``h]h reboot(b)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhc is good when you’re unable to shut down, it is an equivalent of pressing the “reset” button.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(h``crash(c)`` can be used to manually trigger a crashdump when the system is hung. Note that this just triggers a crash if there is no dump mechanism available.h](j)}(h ``crash(c)``h]hcrash(c)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh can be used to manually trigger a crashdump when the system is hung. Note that this just triggers a crash if there is no dump mechanism available.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(hX``sync(s)`` is handy before yanking removable medium or after using a rescue shell that provides no graceful shutdown -- it will ensure your data is safely written to the disk. Note that the sync hasn't taken place until you see the "OK" and "Done" appear on the screen.h](j)}(h ``sync(s)``h]hsync(s)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhX  is handy before yanking removable medium or after using a rescue shell that provides no graceful shutdown -- it will ensure your data is safely written to the disk. Note that the sync hasn’t taken place until you see the “OK” and “Done” appear on the screen.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(h``umount(u)`` can be used to mark filesystems as properly unmounted. From the running system's point of view, they will be remounted read-only. The remount isn't complete until you see the "OK" and "Done" message appear on the screen.h](j)}(h ``umount(u)``h]h umount(u)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh can be used to mark filesystems as properly unmounted. From the running system’s point of view, they will be remounted read-only. The remount isn’t complete until you see the “OK” and “Done” message appear on the screen.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(hXThe loglevels ``0``-``9`` are useful when your console is being flooded with kernel messages you do not want to see. Selecting ``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.)h](hThe loglevels }(hj hhhNhNubj)}(h``0``h]h0}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh-}(hj hhhNhNubj)}(h``9``h]h9}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhf are useful when your console is being flooded with kernel messages you do not want to see. Selecting }(hj hhhNhNubj)}(h``0``h]h0}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh will prevent all but the most urgent kernel messages from reaching your console. (They will still be logged if syslogd/klogd are alive, though.)}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(h``term(e)`` and ``kill(i)`` are useful if you have some sort of runaway process you are unable to kill any other way, especially if it's spawning other processes.h](j)}(h ``term(e)``h]hterm(e)}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc ubh and }(hjc hhhNhNubj)}(h ``kill(i)``h]hkill(i)}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc ubh are useful if you have some sort of runaway process you are unable to kill any other way, especially if it’s spawning other processes.}(hjc hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(h"just thaw ``it(j)``" is useful if your system becomes unresponsive due to a frozen (probably root) filesystem via the FIFREEZE ioctl.h](h “just thaw }(hj hhhNhNubj)}(h ``it(j)``h]hit(j)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubht” is useful if your system becomes unresponsive due to a frozen (probably root) filesystem via the FIFREEZE ioctl.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubh)}(hX``Replay logs(R)`` is useful to view the kernel log messages when system is hung or you are not able to use dmesg command to view the messages in printk buffer. User may have to press the key combination multiple times if console system is busy. If it is completely locked up, then messages won't be printed. Output messages depend on current console loglevel, which can be modified using sysrq[0-9] (see above).h](j)}(h``Replay logs(R)``h]hReplay logs(R)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhX is useful to view the kernel log messages when system is hung or you are not able to use dmesg command to view the messages in printk buffer. User may have to press the key combination multiple times if console system is busy. If it is completely locked up, then messages won’t be printed. Output messages depend on current console loglevel, which can be modified using sysrq[0-9] (see above).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjZ hhubeh}(h]okay-so-what-can-i-use-them-forah ]h"]!okay, so what can i use them for?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hCSometimes SysRq seems to get 'stuck' after using it, what can I do?h]hGSometimes SysRq seems to get ‘stuck’ after using it, what can I do?}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hWhen this happens, try tapping shift, alt and control on both sides of the keyboard, and hitting an invalid sysrq sequence again. (i.e., something like `alt-sysrq-z`).h](hWhen this happens, try tapping shift, alt and control on both sides of the keyboard, and hitting an invalid sysrq sequence again. (i.e., something like }(hj hhhNhNubj )}(h `alt-sysrq-z`h]h alt-sysrq-z}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hUSwitching to another virtual console (`ALT+Fn`) and then back again should also help.h](h&Switching to another virtual console (}(hjhhhNhNubj )}(h`ALT+Fn`h]hALT+Fn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh') and then back again should also help.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]?sometimes-sysrq-seems-to-get-stuck-after-using-it-what-can-i-doah ]h"]Csometimes sysrq seems to get 'stuck' after using it, what can i do?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h7I hit SysRq, but nothing seems to happen, what's wrong?h]h9I hit SysRq, but nothing seems to happen, what’s wrong?}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhKubh)}(hXThere are some keyboards that produce a different keycode for SysRq than the pre-defined value of 99 (see ``KEY_SYSRQ`` in ``include/uapi/linux/input-event-codes.h``), or which don't have a SysRq key at all. In these cases, run ``showkey -s`` to find an appropriate scancode sequence, and use ``setkeycodes 99`` to map this sequence to the usual SysRq code (e.g., ``setkeycodes e05b 99``). It's probably best to put this command in a boot script. Oh, and by the way, you exit ``showkey`` by not typing anything for ten seconds.h](hjThere are some keyboards that produce a different keycode for SysRq than the pre-defined value of 99 (see }(hj?hhhNhNubj)}(h ``KEY_SYSRQ``h]h KEY_SYSRQ}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh in }(hj?hhhNhNubj)}(h*``include/uapi/linux/input-event-codes.h``h]h&include/uapi/linux/input-event-codes.h}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubhA), or which don’t have a SysRq key at all. In these cases, run }(hj?hhhNhNubj)}(h``showkey -s``h]h showkey -s}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh3 to find an appropriate scancode sequence, and use }(hj?hhhNhNubj)}(h``setkeycodes 99``h]hsetkeycodes 99}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh5 to map this sequence to the usual SysRq code (e.g., }(hj?hhhNhNubj)}(h``setkeycodes e05b 99``h]hsetkeycodes e05b 99}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh[). It’s probably best to put this command in a boot script. Oh, and by the way, you exit }(hj?hhhNhNubj)}(h ``showkey``h]hshowkey}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh( by not typing anything for ten seconds.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj.hhubeh}(h]4i-hit-sysrq-but-nothing-seems-to-happen-what-s-wrongah ]h"]7i hit sysrq, but nothing seems to happen, what's wrong?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h=I want to add SysRQ key events to a module, how does it work?h]h=I want to add SysRQ key events to a module, how does it work?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXIn order to register a basic function with the table, you must first include the header ``include/linux/sysrq.h``, this will define everything else you need. Next, you must create a ``sysrq_key_op`` struct, and populate it with A) the key handler function you will use, B) a help_msg string, that will print when SysRQ prints help, and C) an action_msg string, that will print right before your handler is called. Your handler must conform to the prototype in 'sysrq.h'.h](hXIn order to register a basic function with the table, you must first include the header }(hjhhhNhNubj)}(h``include/linux/sysrq.h``h]hinclude/linux/sysrq.h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhE, this will define everything else you need. Next, you must create a }(hjhhhNhNubj)}(h``sysrq_key_op``h]h sysrq_key_op}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX struct, and populate it with A) the key handler function you will use, B) a help_msg string, that will print when SysRQ prints help, and C) an action_msg string, that will print right before your handler is called. Your handler must conform to the prototype in ‘sysrq.h’.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX4After the ``sysrq_key_op`` is created, you can call the kernel function ``register_sysrq_key(int key, const struct sysrq_key_op *op_p);`` this will register the operation pointed to by ``op_p`` at table key 'key', if that slot in the table is blank. At module unload time, you must call the function ``unregister_sysrq_key(int key, const struct sysrq_key_op *op_p)``, which will remove the key op pointed to by 'op_p' from the key 'key', if and only if it is currently registered in that slot. This is in case the slot has been overwritten since you registered it.h](h After the }(hjhhhNhNubj)}(h``sysrq_key_op``h]h sysrq_key_op}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. is created, you can call the kernel function }(hjhhhNhNubj)}(hA``register_sysrq_key(int key, const struct sysrq_key_op *op_p);``h]h=register_sysrq_key(int key, const struct sysrq_key_op *op_p);}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh0 this will register the operation pointed to by }(hjhhhNhNubj)}(h``op_p``h]hop_p}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubho at table key ‘key’, if that slot in the table is blank. At module unload time, you must call the function }(hjhhhNhNubj)}(hB``unregister_sysrq_key(int key, const struct sysrq_key_op *op_p)``h]h>unregister_sysrq_key(int key, const struct sysrq_key_op *op_p)}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, which will remove the key op pointed to by ‘op_p’ from the key ‘key’, if and only if it is currently registered in that slot. This is in case the slot has been overwritten since you registered it.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe Magic SysRQ system works by registering key operations against a key op lookup table, which is defined in 'drivers/tty/sysrq.c'. This key table has a number of operations registered into it at compile time, but is mutable, and 2 functions are exported for interface to it::h]hXThe Magic SysRQ system works by registering key operations against a key op lookup table, which is defined in ‘drivers/tty/sysrq.c’. This key table has a number of operations registered into it at compile time, but is mutable, and 2 functions are exported for interface to it:}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj[)}(h,register_sysrq_key and unregister_sysrq_key.h]h,register_sysrq_key and unregister_sysrq_key.}hjhsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhM hjhhubh)}(hXOf course, never ever leave an invalid pointer in the table. I.e., when your module that called register_sysrq_key() exits, it must call unregister_sysrq_key() to clean up the sysrq key table entry that it used. Null pointers in the table are always safe. :)h]hXOf course, never ever leave an invalid pointer in the table. I.e., when your module that called register_sysrq_key() exits, it must call unregister_sysrq_key() to clean up the sysrq key table entry that it used. Null pointers in the table are always safe. :)}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXIf for some reason you feel the need to call the handle_sysrq function from within a function called by handle_sysrq, you must be aware that you are in a lock (you are also in an interrupt handler, which means don't sleep!), so you must call ``__handle_sysrq_nolock`` instead.h](hIf for some reason you feel the need to call the handle_sysrq function from within a function called by handle_sysrq, you must be aware that you are in a lock (you are also in an interrupt handler, which means don’t sleep!), so you must call }(hjhhhNhNubj)}(h``__handle_sysrq_nolock``h]h__handle_sysrq_nolock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh instead.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h];i-want-to-add-sysrq-key-events-to-a-module-how-does-it-workah ]h"]=i want to add sysrq key events to a module, how does it work?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hJWhen I hit a SysRq key combination only the header appears on the console?h]hJWhen I hit a SysRq key combination only the header appears on the console?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXSysrq output is subject to the same console loglevel control as all other console output. This means that if the kernel was booted 'quiet' as is common on distro kernels the output may not appear on the actual console, even though it will appear in the dmesg buffer, and be accessible via the dmesg command and to the consumers of ``/proc/kmsg``. As a specific exception the header line from the sysrq command is passed to all console consumers as if the current loglevel was maximum. If only the header is emitted it is almost certain that the kernel loglevel is too low. Should you require the output on the console channel then you will need to temporarily up the console loglevel using `alt-sysrq-8` or::h](hXPSysrq output is subject to the same console loglevel control as all other console output. This means that if the kernel was booted ‘quiet’ as is common on distro kernels the output may not appear on the actual console, even though it will appear in the dmesg buffer, and be accessible via the dmesg command and to the consumers of }(hjhhhNhNubj)}(h``/proc/kmsg``h]h /proc/kmsg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX[. As a specific exception the header line from the sysrq command is passed to all console consumers as if the current loglevel was maximum. If only the header is emitted it is almost certain that the kernel loglevel is too low. Should you require the output on the console channel then you will need to temporarily up the console loglevel using }(hjhhhNhNubj )}(h `alt-sysrq-8`h]h alt-sysrq-8}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj[)}(hecho 8 > /proc/sysrq-triggerh]hecho 8 > /proc/sysrq-trigger}hjsbah}(h]h ]h"]h$]h&]jjjkuh1jZhhhM'hjhhubh)}(hcRemember to return the loglevel to normal after triggering the sysrq command you are interested in.h]hcRemember to return the loglevel to normal after triggering the sysrq command you are interested in.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hjhhubeh}(h]Iwhen-i-hit-a-sysrq-key-combination-only-the-header-appears-on-the-consoleah ]h"]Jwhen i hit a sysrq key combination only the header appears on the console?ah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h%I have more questions, who can I ask?h]h%I have more questions, who can I ask?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM-ubj)}(hhh]j)}(hMJust ask them on the linux-kernel mailing list: linux-kernel@vger.kernel.org h](j)}(h/Just ask them on the linux-kernel mailing list:h]h/Just ask them on the linux-kernel mailing list:}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM0hj'ubj)}(hhh]h)}(hlinux-kernel@vger.kernel.orgh]h reference)}(hj>h]hlinux-kernel@vger.kernel.org}(hjBhhhNhNubah}(h]h ]h"]h$]h&]refuri#mailto:linux-kernel@vger.kernel.orguh1j@hj<ubah}(h]h ]h"]h$]h&]uh1hhhhM0hj9ubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhhhM0hj$ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]#i-have-more-questions-who-can-i-askah ]h"]%i have more questions, who can i ask?ah$]h&]uh1hhhhhhhhM-ubh)}(hhh](h)}(hCreditsh]hCredits}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhhhhhM3ubj)}(hhh](j)}(h(Written by Mydraal h]h)}(hjh](hWritten by Mydraal <}(hjhhhNhNubjA)}(hvulpyne@vulpyne.neth]hvulpyne@vulpyne.net}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:vulpyne@vulpyne.netuh1j@hjubh>}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM5hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h,Updated by Adam Sulmicki h]h)}(hjh](hUpdated by Adam Sulmicki <}(hjhhhNhNubjA)}(hadam@cfar.umd.eduh]hadam@cfar.umd.edu}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:adam@cfar.umd.eduuh1j@hjubh>}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM6hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hBUpdated by Jeremy M. Dolan 2001/01/28 10:15:59h]h)}(hjh](hUpdated by Jeremy M. Dolan <}(hjhhhNhNubjA)}(hjmd@turbogeek.orgh]hjmd@turbogeek.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:jmd@turbogeek.orguh1j@hjubh> 2001/01/28 10:15:59}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM7hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h?Added to by Crutcher Dunnavant h]h)}(hjh](h Added to by Crutcher Dunnavant <}(hj hhhNhNubjA)}(hcrutcher+kernel@datastacks.comh]hcrutcher+kernel@datastacks.com}(hjhhhNhNubah}(h]h ]h"]h$]h&]refuri%mailto:crutcher+kernel@datastacks.comuh1j@hj ubh>}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM8hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jxjyuh1jhhhM5hjqhhubeh}(h]creditsah ]h"]creditsah$]h&]uh1hhhhhhhhM3ubeh}(h]$linux-magic-system-request-key-hacksah ]h"]$linux magic system request key hacksah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjierror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jDjAhhjjjjjW jT j j j+j(jjjjjj jnjkj<j9u nametypes}(jDhjjjW j j+jjjjnj<uh}(jAhhhjhjjjT jj jZ j(j jj.jjj jjkjj9jqu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.