How can I know what keys will invoke the magic SysRq key? Provided I am in front of a Linux machine which is not frozen (yet). I need something easier than trying all common combinations of magic SysRq key to discover if it's working.
Linux – How to discover whether magic SysRq key is enabled, and what keys invoke it
linuxmagic-sysrq
Best Answer
The magic SysRq key itself is AltSysRq or AltPrint Screen on PCs, which is in turn combined with a third key (letter), indicating some specific action.
The short version is that, at a console, AltSysRqSpace will display the available shortcuts (thanks to Josip Rodin for pointing that out).
The magic SysRq key, if enabled, is controlled by
/proc/sys/kernel/sysrq
; you can determine if it's enabled and what functions are allowed by runningIf this complains that there's no such file or directory, then magic SysRq isn't enabled at all. Otherwise it will show a number which determines the available functions:
sync
If the system is operational as far as having a working
root
shell, you can also invoke a magic SysRq function by writing its letter to/proc/sysrq-trigger
; e.g.will perform an emergency
sync
.This is all detailed in the kernel documentation.