Basically, the "Magic SysRq Key" is a key combination that the Linux Kernel will respond to, no matter the state of the system. This came up recently, when an old decrepit RHEL2.1AS system failed to respond after its schedule monthly reboot. We're a fairly small IT shop and don't have any iLO, DRAC or RSA cards (or even a BladeCenter) installed in our systems for hardware management of our devices. The system was in a hung state and had shutdown all services, consoles, etc, but was stuck on a java process. We have an IP KVM so we were able to see the system's state, but unable to action it.
Ultimately, a site visit was required and a quick hard reset brought the system back up. However, had we'd known about the "Magic SysRq Key", we may have been able to avoid a trip to the office.
According to Wikipedia (the God of all IT -- of course) the following options are available:
Action | QWERTY | Dvorak | AZERTY |
---|---|---|---|
Set the console log level, which controls the types of kernel messages that are output to the console | 0 through 9 | 0 through 9 | 0 through 9 (without using shift) |
Immediately reboot the system, without unmounting partitions or syncing | b | x | b |
Reboot kexec and output a crashdump | c | j | c |
Display all currently held Locks | d | e | d |
Send the SIGTERM signal to all processes except init (PID 1) | e | . | e |
Call oom_kill, which kills a process to alleviate an OOM condition | f | u | f |
When using Kernel Mode Setting, provides emergency support for switching back to the kernel's framebuffer console[3] | g | i | g |
Output a terse help document to the console Any key which is not bound to a command should also perform this action | h | d | h |
Send the SIGKILL signal to all processes except init | i | c | i |
Kill all processes on the current virtual console (Can be used to kill X and svgalib programs, see below) This was originally designed to imitate a Secure Access Key | k | t | k |
Output current memory information to the console | m | m | , |
Reset the nice level of all high-priority and real-time tasks | n | b | n |
Shut off the system | o | r | o |
Output the current registers and flags to the console | p | l | p |
Display all active high-resolution timers and clock sources. | q | ' | a |
Switch the keyboard from raw mode, the mode used by programs such as X11 and svgalib, to XLATE mode | r | p | r |
Sync all mounted filesystems | s | o | s |
Output a list of current tasks and their information to the console | t | y | t |
Remount all mounted filesystems in read-only mode | u | g | u |
Output Voyager SMP processor information | v | k | v |
Display list of blocked (D state) tasks | w | , | z |
unRaw (take control of keyboard back from X),
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes, forcing them to terminate immediately),
Sync (flush data to disk),
Unmount (remount all filesystems read-only),
reBoot.
No comments:
Post a Comment