You are here: Home / Projects / OSADL Linux Add-on Patch / 
2020-04-07 - 00:16
OSADL Projects

OSADL Linux Add-on Patch: Ping SysRq

Ping SysRqNMI SysRqLatency histogramsBuilt-in kernel patchsetPrecise load measurement

What is SysRq?

The SysRq functionality is provided to allow sending diagnostic or recovery commands to the Linux kernel in a situation when normal I/O is no longer possible because of, for example, a system crash. SysRq usually is triggered from the keyboard by simultaneously pressing the RightAlt and the SysRq (PrntScrn) key. However, the system may be impaired in such a way that even the keyboard interrupt stopped working. If the network is still up and running and able to receive ICMP packets, this Ping SysRq function may help. In order to work, the target system must have defined a particular pattern – preferably at boot time – that will be used as a key to authorize the SysRq action from remote.

Example prerequisite on target

echo 0x01020304 >/proc/sys/net/ipv4/icmp_echo_sysrq

Ping command on remote system

ping -c1 -s57 -p01020304<ASCII hex command> target

Example: Gracefully reboot system

SysRq S (sync block devices) = ASCII 0x73:

ping -c1 -s57 -p0102030473 target

SysRq U (unmount block devices) = ASCII 0x75:

ping -c1 -s57 -p0102030475 target

SysRq B (reboot) = ASCII 0x62:

ping -c1 -s57 -p0102030462 target

Download patch