EasyManua.ls Logo

Inspur OS - Configuring the Linux Magic Sysrq Key

Inspur OS
276 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
256
10.4 Configuring the Linux Magic SysRq Key
The magic SysRq key is a magical key combination. As long as you press it, the
kernel will respond immediately regardless of the system’s state.
The SysRq facility is one of the best (and sometimes the only) way to determine
what a machine is really doing. It is most useful when the server appears to be
“hung”, and for diagnosing elusive, transient, kernel-related problems. Since
enabling SysRq facility gives someone with physical console access extra abilities,
we recommend you to disable it when not troubleshooting a problem or to ensure
that physical console access is properly secured.
When you test whether the kdump configuration takes effect, executing the echo
c > /proc/sysrq-triger command also requires the support of the SysRq key.
1. Check the current SysRq state.
# cat /proc/sys/kernel/sysrq
2. If the value is 0, the SysRq key is disabled. Set the value to 1.
The available values in /proc/sys/kernel/sysrq are described below:
0 - disable sysrq completely
1 - enable all functions of sysrq
3. Trigger the SysRq key.
The SysRq key can be triggered using the following key combination in CLI, not
available in GUI:
<Alt> + <PrintScreen> + <CommandKey>
If the keyboard can respond, the SysRq key can also be triggered by executing
the following command:
#echo [CommandKey] > /proc/sysrq-trigger
When a SysRq command is triggered, the kernel will print out the information to
the kernel ring buffer and to the system console. This information is normally
logged via syslog to /var/log/messages. However, the OS may be unable to
record logs when it crashes. In this case, we recommend you to collect logs via the
serial port.
As for the <CommandKey>, common SysRq events include:
m - dump information about memory allocation
w - dumps tasks that are in uninterruptable (blocked) state
t - dump thread state information

Table of Contents

Related product manuals