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.
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 running
If 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:
- 0: disable SysRq completely
- 1: enable all functions
- any other value is a bitmask of allowed functions:
- 2: control console logging level
- 4: control keyboard
- 8: process debug dumping
- 32: read-only remounts
- 64: process signalling
- 128: reboot/power-off
- 256: nicing of all RT tasks
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
echo s > /proc/sysrq-trigger
will perform an emergency
This is all detailed in the kernel documentation.