/proc/sysrq-trigger detailed

Source: Internet
Author: User
Tags documentation


# Restart your computer now
echo "B" >/proc/sysrq-trigger # Shut down the computer now
echo "O" >/proc/sysrq-trigger # Export memory allocation information (can be viewed with/var/log/message)
echo "M" >/proc/sysrq-trigger # Export current CPU register information and flag bit information
echo "P" >/proc/sysrq-trigger # Export thread state information
echo "T" >/proc/sysrq-trigger to crash the system deliberately
echo "C" >/proc/sysrq-trigger to mount all file systems now
echo "S" >/proc/sysrq-trigger instantly mount all file systems as read-only
echo "U" >/proc/sysrq-triggerdocumentation for SYSRQ.C   Based on kernel version 2.6.38. Page generated on 2011-03-22 22:20 EST.   1        Linux Magic System Request Key Hacks 2        documentation for SYSRQ.C 3        4         * what is the Magic sysrq key? 5        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6        It is a ' Magical ' key combo you can hit which the kernel'll respond to 7        regardless of what Ever else it is doing and unless it is completely locked up. 8        9        * how do I enable the Magic SysRq key?      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      You need to say "yes" ' Magic sysrq key (CONFIG_MAGIC_SYSRQ) ' When      configuring the kernel. When running a kernel With SysRq compiled,     /PROC/SYS/KERNEL/SYSRQ controls the functions allowed to be invoked V IA      the SYSRQ key. By default the file contains 1 which means, every      possible SYSRQ request is allowed (in OL Der versions SysRq is disabled      by default, and your were required to specifically enable it at Run-time      But this isn't the case no more. This is the list of possible values      in/proc/sys/kernel/sysrq:19      &NB sp;  0-disable SysRq completely         1-enable all functions of SysRq &nbsp ;     >1-bitmask of allowed SYSRQ functions (for more below ;         description):                 2-enAble control of console logging level                 4-enable Control of keyboard (SAK, Unraw)                 8-enable Debugging dumps of processes etc           &nbsp ;   16-enable Sync command               32- Enable Remount read-only               64-enable Signalling of processes (term, kill, Oom-kill)              128-allow reboot/poweroff              256-allow nicing of a ll RT Tasks           You can set the ' value in the ' file by the following COM Mand:33        &nbsp echo "number" &GT;/PROC/SYS/KERNEL/SYSRQ           Note this value of/p Roc/sys/kernel/sysrq influences only the invocation      via a keyboard. Invocation of Operation Via/proc/sysrq-trigger is always Notoginseng      allowed (by a user with admin PR Ivileges).           * how do I use the Magic sysrq key?      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      on x86  - Press the key combo ' Alt-sysrq-<command key> '. Note-some                 keyboards May 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 in the same time, so might bsp;              have better luck with "press Alt", " Press SYSRQ ", Release SysRq",                  "Press <command key>", release everything.           on Sparc-you Press ' Alt-stop-<command key> ', I believe.           on the serial console (PC style standard serial ports only)-51 & nbsp;               Your send a break, then within 5 Seconds a command key. Sending                 break twice is interpreted as a normal break.           on PowerPc-press ' alt-print screen (or F13)-<command key>,           & nbsp;        Print screen (or F13)-<command key> may suffice.           on Other-if your know of the key combos for other architectures, Please                 let me know so I can add them to this section.           on all- write a character to/proc/sysrq-trigger.  e.g.:                              echo T >/proc/sysrq-trigger            * what are the ' command ' keys?      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      ' B '     -would immediately reboot the system without syncing or unmounting      &NBSP;&N bsp;        your disks.      i      ' C '     -would perform a system crash by a NUL L pointer dereference.   # Restart your computer now echo "B" >/proc/sysrq-trigger # immediately turn off the computer echo "O" >/proc/sysrq-trigger # Export memory allocation information (available/ Var/log/message view) echo "M" >/proc/sysrq-trigger # Export current CPU register information and flag bit information echo "P" >/proc/sysrq-trigger # Export Thread state information echo "T" >/proc/sysrq-trigger # deliberately let the system crash echo "C" >/proc/sysrq-trigger # immediately reload all file systems echo "s" &G T /proc/sysrq-trigger # immediately reload all file systems for read-only echo "U" >/proc/sysrq-trigger

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.