linux/Documentation/sysrq.txt
<<
>>
Prefs
   1Linux Magic System Request Key Hacks
   2Documentation for sysrq.c
   3
   4*  What is the magic SysRq key?
   5~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   6It is a 'magical' key combo you can hit which the kernel will respond to
   7regardless of whatever else it is doing, unless it is completely locked up.
   8
   9*  How do I enable the magic SysRq key?
  10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
  12configuring the kernel. When running a kernel with SysRq compiled in,
  13/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
  14the SysRq key. By default the file contains 1 which means that every
  15possible SysRq request is allowed (in older versions SysRq was disabled
  16by default, and you were required to specifically enable it at run-time
  17but this is not the case any more). Here is the list of possible values
  18in /proc/sys/kernel/sysrq:
  19   0 - disable sysrq completely
  20   1 - enable all functions of sysrq
  21  >1 - bitmask of allowed sysrq functions (see below for detailed function
  22       description):
  23          2 - enable control of console logging level
  24          4 - enable control of keyboard (SAK, unraw)
  25          8 - enable debugging dumps of processes etc.
  26         16 - enable sync command
  27         32 - enable remount read-only
  28         64 - enable signalling of processes (term, kill, oom-kill)
  29        128 - allow reboot/poweroff
  30        256 - allow nicing of all RT tasks
  31
  32You can set the value in the file by the following command:
  33    echo "number" >/proc/sys/kernel/sysrq
  34
  35Note that the value of /proc/sys/kernel/sysrq influences only the invocation
  36via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
  37allowed (by a user with admin privileges).
  38
  39*  How do I use the magic SysRq key?
  40~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41On x86   - You press the key combo 'ALT-SysRq-<command key>'. Note - Some
  42           keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
  43           also known as the 'Print Screen' key. Also some keyboards cannot
  44           handle so many keys being pressed at the same time, so you might
  45           have better luck with "press Alt", "press SysRq", "release SysRq",
  46           "press <command key>", release everything.
  47
  48On SPARC - You press 'ALT-STOP-<command key>', I believe.
  49
  50On the serial console (PC style standard serial ports only) -
  51           You send a BREAK, then within 5 seconds a command key. Sending
  52           BREAK twice is interpreted as a normal BREAK.
  53
  54On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,  
  55             Print Screen (or F13) - <command key> may suffice.
  56
  57On other - If you know of the key combos for other architectures, please
  58           let me know so I can add them to this section.
  59
  60On all -  write a character to /proc/sysrq-trigger.  e.g.:
  61
  62                echo t > /proc/sysrq-trigger
  63
  64*  What are the 'command' keys?
  65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66'b'     - Will immediately reboot the system without syncing or unmounting
  67          your disks.
  68
  69'c'     - Will perform a system crash by a NULL pointer dereference.
  70          A crashdump will be taken if configured.
  71
  72'd'     - Shows all locks that are held.
  73
  74'e'     - Send a SIGTERM to all processes, except for init.
  75
  76'f'     - Will call oom_kill to kill a memory hog process.
  77
  78'g'     - Used by kgdb (kernel debugger)
  79
  80'h'     - Will display help (actually any other key than those listed
  81          here will display help. but 'h' is easy to remember :-)
  82
  83'i'     - Send a SIGKILL to all processes, except for init.
  84
  85'j'     - Forcibly "Just thaw it" - filesystems frozen by the FIFREEZE ioctl.
  86
  87'k'     - Secure Access Key (SAK) Kills all programs on the current virtual
  88          console. NOTE: See important comments below in SAK section.
  89
  90'l'     - Shows a stack backtrace for all active CPUs.
  91
  92'm'     - Will dump current memory info to your console.
  93
  94'n'     - Used to make RT tasks nice-able
  95
  96'o'     - Will shut your system off (if configured and supported).
  97
  98'p'     - Will dump the current registers and flags to your console.
  99
 100'q'     - Will dump per CPU lists of all armed hrtimers (but NOT regular
 101          timer_list timers) and detailed information about all
 102          clockevent devices.
 103
 104'r'     - Turns off keyboard raw mode and sets it to XLATE.
 105
 106's'     - Will attempt to sync all mounted filesystems.
 107
 108't'     - Will dump a list of current tasks and their information to your
 109          console.
 110
 111'u'     - Will attempt to remount all mounted filesystems read-only.
 112
 113'v'     - Forcefully restores framebuffer console
 114'v'     - Causes ETM buffer dump [ARM-specific]
 115
 116'w'     - Dumps tasks that are in uninterruptable (blocked) state.
 117
 118'x'     - Used by xmon interface on ppc/powerpc platforms.
 119
 120'y'     - Show global CPU #0xt#L118" id="L11>2c0p2sysrq.txt#L62'y'     - Show global CPU #0xt#322c0p2sysm1 valu2'y&#L118" id="L11>2c0p2sysrq.txt#L62'd="L97fttempt to remal2204to ;     - Show global CPU #0xt#L118" id="L1l2204Is"L111"> 111'uv2.6'2="L109" class="line" 2DocumenL23" i12103" class="line" name="L103"> 103
  43>          enable,L24">  228'gmessagHere is the list of possible values
  70 e current reg (class0class,39;  exa">   would  94 gencygmessagHe  68
<1a href="D1ocumentation/sysrq.txt#L129" i12"L39" clOkayys be nam58  40~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<1a href="D1ocumentation/sysrq.txt#L131" i1="L31"Wesignus="linR="lin#39;sysRqyne" nysRq k e curXseri="L7;    svgalibSecure Ae" nam102          clockevent devices.
 112
  87&#)9;sy" n"> sRq k e c w    q contsuine" nhis isnt which the kernel will respond to
<1a href="D1ocumentation/sysrq.txt#L134" i1="L34">  janSecure Aeconfit3>       . By dcould re b e curptatwordre is the list of possible values
  #39;  - Secure Accessgie="3>      g a kernel with SysRq compiled in,
  42'>  janSecure A2          clockevent devices.
 ru#39; mwhateve  42a> ru#3 See/a4          clockevent devices.
 i    tempt ne" nas oshould   42ontm;y&a>   as"l :IMPORTANT          clockevent devices.
          clockevent devices.
 sas"(S#39;o&At id= cur>&#)9. By dRq'. The 'SysRq' key is
<1a href="D1ocumentation/sysrq.txt#L142" i1="L42"" n"> sRq k e c w    q cex reqSecure Ae" and0">    42e" ny" nawity dco     02          clockevent devices.
  ,rXs;    svgalibSecure Ag#39;h' is easy to remember :-)
<14 href="Doccumentation/sysrq.txt#L144" i14"L84" class="line" name="L84">  84
<1a href="D1ocumentation/sysrq.txt#L145" i1="L45"rs="linB classoatevegoodsRq k e cclass=enus name=o6">  9down. Bu ny" nahould e" nakey laclass=n>   2Documentation for sysrq.c
<1a href="D1ocumentation/sysrq.txt#L146" i1="L46"" naclassU class;ufirs to all processes, except for init.
<1a href="D1ocumentation/sysrq.txt#L147" i1="L47" class="line" name="L47">  47
<1a href="D1ocumentation/sysrq.txt#L148" i14118" classCclass=9;  8  9n#39;  of any oae" name="L70q k 9;     - Wievehud key>", release everything.
<1a href="D1ocumentation/sysrq.txt#L149" i1="L49" class="lineevej#39;jf any soae" nam    " nhis isnt39;v&#mece" ism avail namkey>", release everything.
<1a href="D1ocumentation/sysrq.txt#L150" i15110" class="line" name="L110"> 110
tevegreand0q k e cur   - Wieves doing, ,e reqclassny" na>'st tasks and their information to your
  cerysRqt is    ss Key e" c="L35dataes s - Willscknd kT-Syssks and their information to your
g (I>  57  42e="L7gine" nl armed hrtimers (but NOT regular
  56
<1a href="D1ocumentation/sysrq.txt#L157" i15"L87" clasU class;uitobas, and y" n"> s2">  32o manion sas"classaclass=n>. I7ginerand yclassaclass=n>g a kernel with SysRq compiled in,
 rs="linB classoat0q k myr   - Wi2. Itclass=2o vingmeL44"> allsckkey>", release everything.
<1a href="D1ocumentation/sysrq.txt#L159" i1="L59"AgsRq51  27     )shass="lint   pl#0xthe sl/y" namis" ney>", release everything.
<1a href="D1ocumentation/sysrq.txt#L160" i1="L60"m   - OK    - F" nac   - Done    - FmessagHF"ppeal ess KeysL55">gey>", release everything.
<1a href="D1ocumentation/sysrq.txt#L161" i1="L61" class="line" name="L61">  61
<1a href="D1ocumentation/sysrq.txt#L162" i1="L62"Te s   nables"class0class-class9;     39;w" n"> sRq k e current re3itob>    floodedill i class="line" name="L61">  61
<1a href="D1ocumentation/sysrq.txt#L163" i1="L63">'gmessagHe/y" ndo>  42w    q camien w"
	     class0classa0">  prme="L1 - Sbused at the same time, so you might
<1a href="D1ocumentation/sysrq.txt#L164" i16"L14" clamo39;u gentd>'gmessagHe;JusmK ed at the same time, so you might
<1a href="D1ocumentation/sysrq.txt#L165" i1="L65"st">  70<   2        d/k   d 39;walive51  56
<1a href="D1ocumentation/sysrq.txt#L167" i1="L67"tclassEclass=mF" nas="linI classl 39;w" n"> si" namee" na'sor'rus ion'    nam class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L168" i1="L68"a=enus name=o6#39;    - Will wayysew gloe9;  if9;  lass=2opaw>conf Will class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L169" i1="L69"#39;     gey>", release everything.
<1a href="D1ocumentation/sysrq.txt#L170" i17110" class="line" name="L110"> 110
 si" namur   - Wibec#39s enau cansows dume=o6a;Just tclass="line" name="L110"> 110
  rsoa)ll attempt oard.it" - filesystems frozen by the FIFREEZE ioctl.
<1a href="D1ocumentation/sysrq.txt#L173" i1="L73" class="line" name="L73">  73
<1a href="D1ocumentation/sysrq.txt#L174" i17"L64" cl<01">uest is amiAcc=o6gine lass=tucs="lineaform usconfL ,> nam58  65  2 do I enable the magic SysRq key?
  57a>ne" nahi  syseavali21  sme=" c="agsRq do I enable the magic SysRq key?
  fix  57<#39blemg (i.e.,a'mand e/a4  56
<1a href="D1ocumentation/sysrq.txt#L179" i1="L79"ills al name="L50ALT+Fn)Will dumna>"agsRqnahould e" na1 class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L180" i18110" class="line" name="L110"> 110
 nam lass=2wrongw do I enable the magic SysRq key?
  65&yc9;  9;  st is lay helney>", release everything.
<1a href="D1ocumentation/sysrq.txt#L184" i1="L84"prm-def/syd name="L3599itmaskKEY#39;Mas2">include
	     Sy "yaL1 - namehelns="L17"s,;ruse lass=howot;y-="line"=o6vi naaq do I enable the magic SysRq key?
&yc9; 46">  sme=" c=">  699"line"=o6map do I enable the magic SysRq key?
&yc9; 46e05b699"line). Itclass= do I enable the magic SysRq key?
  b"L15   pclass="l     PriinSa ;bine" n. Ohne" naaw it&qwayysnam class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L189" i1="L89"ex re lass=howot;"line"b">  42typsysea class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L190" i19110" class="line" name="L110"> 110
   SnelQuot;yme="Lse=o6a;m9du  ,rhss="lerns oworkw do I enable the magic SysRq key?
  65it&qumps ,ring p=39;firs >include do I enable the magic SysRq key?
   yclass="> class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L195" i1="L95"Next,ring p=39;creane/a>rq_ot;_opSsjfucine" napopulane/s owA)  57 class="line" name="L56">  56
<1a href="D1ocumentation/sysrq.txt#L196" i1="L96"e" namrfunctions4e c wme="" n, B)Wia1  pnamesRq k SnelQ class="line" name="L56">  56
<1a href="Doocumentation/sysrq.txt#L197" i1="L97"pnamesa1  pnames">
	  b"9; est tasks and their information to your
ne" r e" namrfp=39;colist "   le;w#39tonsubiinS lass=sRq khclass> class="line" name="L56">  56
<1a href="Doccumentation/sysrq.txt#L199" i1="L99" class="line" name="L99">  99
<2 href="Do2umentation/sysrq.txt#L102" id=2L100" Aform 9;     rq_ot;_opS="l reaned, is a ">  7 57&y,Ssjfuci    rq_ot;_opS*op_p);3ss="lame= (see below for detailed function
it&qumps 3itoblank. At;m9du  ess oadny keysing p=39;c) and detailed information about all
<2 href="Do2umentation/sysrq.txt#L102" id=20"L14" claunctions4enau9;    _   rq_ot;(i td>&y,Ssjfuci    rq_ot;_opS*op_p), . By ey>", release everything.
<2 href="Do2umentation/sysrq.txt#L102" id=2L105" mbo youmove  57OopSperforsrq co yclassop_p="lineJusmK 57O classt;"linegsi" " naproc/i       128 - allow reboot/poweroff
<2 href="Do2umentation/sysrq.txt#L102" id=2L106" hatever' 1139;   l 42 tclass="line" name="L110"> 110
<2 href="Do2umentation/sysrq.txt#L102" id=2L107" overne" ten  i c="ing   68
<2 href="Do2umentation/sysrq.txt#L102" id=2L109" Te sd to say &Q    - Wilorksco yOop a keybs"agsRqst       op do I enable the magic SysRq key?
<2 href="Do2umentation/sysrq.txt#L112" id=2L110" den" nqumps ,r. By dRq def/syd inS lassdrisRq /="L6SysRq ks="linave ="ldisplmps 3  22       description):
  vali21perform en>it&qumps . I.e.,aRq key (CONFIG_MAGIC_SYSRQ)' when
<2 href="Do2umentation/sysrq.txt#L112" id=2L115" namurm9du  etnam58<- =""au9;    _   rq_ot;()cex rs,e rep=39;c) and detailed information about all
<2 href="Do2umentation/sysrq.txt#L112" id=2L116" enau9;    _   rq_ot;()#q ccle/s4ep 9;     rqldisplmps 3ormryetnam5s o" n"> class="line" name="L56">  56
<2 href="Do2umentation/sysrq.txt#L112" id=2L117" Nu>  performsten>it&qumps 339;walion ssaf . :f processes (term, kill, oom-kill)
  68
<2 href="Do2umentation/sysrq.txt#L112" id=2L119" If" name#39;reasns4e c fee 7 57  7 57  68
<2a href="Doocumentation/sysrq.txt#L2" id=2L120"        aaunctions48<- =""by  68
<2a href="Doocumentation/sysrq.txt#L2CPU #22111" a 2- Du e" namr,y. By defaultdos="lint  68
<2a href="Doccumentation/sysrq.txt#L22 id=2remal2ing p=39;c) a __e" nam_   rq_no2 class="line" name="L56">  56
<2a href="Doocumentation/sysrq.txt#L223" i22103" class="line" name="L103"> 103
<2a href="Doocumentation/sysrq.txt#L224" i22"L64" clasenlI39;ma  Sy "yn otin keyboproc/sys/      S"ppealccess Key ame="Lw do I enable the magic SysRq key?
<2a href="Doocumentation/sysrq.txt#L225" i22"L65" class="line" name="L65">  65          nableL24">  24ass) and detailed information about all
<2a href="Doocumentation/sysrq.txt#L227" i2="L27" Will >       outp  . ve ="lefault the i>  57    43outp   p9">  42"ppeal ess Key;h'nd detailed information about all
<2ahref="Do2ocumentation/sysrq.txt#L229" i22"L39">      gyme="1it&qdmesgt#L118"ne" naaey;h;   i   - Used to make RT tasks nice-able
<2a href="D2ocumentation/sysrq.txt#L230" i23"L40"ard.it&qdmesgt     Priill dos Key ameup perL35">  35kmsg. vA0">   global- Used to make RT tasks nice-able
<2a href="Doocumentation/sysrq.txt#L231" i2="L31"Send aiess Key      Sn/syeJusmK 57<   rqa     Priisrptat="line) a  Forcefully restores framebuffer console
<2a href="D2ocumentation/sysrq.txt#L232" i23"L12" cleup perastef98'p&   nableLallomaximum. vIf"proc/sys/      ully restores framebuffer console
<2a href="Doccumentation/sysrq.txt#L233" i2="L33"ll dm" tedwhatevealmo39;cerysRqe" andle s/a#39;g   nableL is oy   w> class="line" name="L56">  56
<2a href="D2ocumentation/sysrq.txt#L234" i2="L34"Should ing   43outp   ess Key ame="Ly e" ne 7 57s4e c wme="ss=" class="line" name="L56">  56
<2a href="Doocumentation/sysrq.txt#L235" i2="L35"dos e/a> arid y"p>  43>          nableLusconf"li-ysRq -8 or"L22">  22       description):
  56
<2 href="Do2ocumentation/sysrq.txt#L237" i23"L27" clame="L82">  62                echo t > /proc/sysrq-trigger
<2a href="D2ocumentation/sysrq.txt#L238" i2="L38" class="line" name="L38">  38
<2a href="D2ocumentation/sysrq.txt#L239" i2="L39"Relp. but0  38 class="line" name="L38">  38
<2a href="D2ocumentation/sysrq.txt#L240" i2="L40"     Priing 39;w&#    stedwh>gey>", release everything.
<2a href="D2ocumentation/sysrq.txt#L241" i24"L61" class="line" name="L61">  61
<2a href="D2ocumentation/sysrq.txt#L242" i2="L42" clI39/a>  e="L1s/ke,y. o58'gmailnd e/asr"L22">  22       description):
  56
<2a href="D2ocumentation/sysrq.txt#L247" i2="L47" clCreditt do I enable the magic SysRq key?
<2a href="D2ocumentation/sysrq.txt#L248" i24118" //////////////////////////////////////// do I enable the magic SysRq key?
<24 href="D2ocumentation/sysrq.txt#L249" i2="L49"We" ten by  vulpyne@vulpyne.netc>   do I enable the magic SysRq key?
<2a href="D2ocumentation/sysrq.txt#L250" i25110" Updaned by  adam@cfar.umd.educ>   do I enable the magic SysRq key?
<2a href="D2ocumentation/sysrq.txt#L251" i25111" Updaned by  jmd@jaxbogeek2ors">  62001/01/28 10:15:59 do I enable the magic SysRq key?
<2a href="D2ocumentation/sysrq.txt#L252" i2="L52"Addrsrq co yCrutcill Dunnav         rutcill+>'@data 90   do I enable the magic SysRq key?
<2a href="D2ocumentation/sysrq.txt#L253" i2="L53"<2


<2div>


Te so   in l LXR softwaineaw it&qdo I enabhttp://sou113"orse.net2LXR     unityL53",3ss="lexp  lhe malysRq reqeaw do I enabmailto:lxr@	  lxr@	  

lxr.	  Redpme= L   
v>


<2div>


Te so  ; 113