Linux/sysrq

From Omnia
Revision as of 15:43, 31 August 2017 by Kenneth (talk | contribs) (Created page with "== Emergency Reboot == <pre> echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger </pre> synonymous with holding down Alt-SysRq and another key on older keyboards...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Emergency Reboot

echo 1 > /proc/sys/kernel/sysrq 
echo b > /proc/sysrq-trigger

synonymous with holding down Alt-SysRq and another key on older keyboards

Dropping 1 into /proc/sys/kernel/sysrq tells the kernel that you want to enable SysRq access (it’s usually disabled).

The second command is equivalent to pressing Alt-SysRq-b on a QWERTY keyboard.

If you want to keep SysRq enabled all the time, you can do that with an entry in your server’s sysctl.conf:

kernel.sysrq = 1

Ref: Linux: emergency reboot or shutdown with magic commands - major.io - https://major.io/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/

Emergency Shutdown

echo 1 > /proc/sys/kernel/sysrq 
echo o > /proc/sysrq-trigger