hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/Documentation/admin-guide/sysrq.rst
....@@ -48,9 +48,10 @@
4848 How do I use the magic SysRq key?
4949 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5050
51
-On x86 - You press the key combo :kbd:`ALT-SysRq-<command key>`.
51
+On x86
52
+ You press the key combo :kbd:`ALT-SysRq-<command key>`.
5253
53
-.. note::
54
+ .. note::
5455 Some
5556 keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
5657 also known as the 'Print Screen' key. Also some keyboards cannot
....@@ -58,14 +59,15 @@
5859 have better luck with press :kbd:`Alt`, press :kbd:`SysRq`,
5960 release :kbd:`SysRq`, press :kbd:`<command key>`, release everything.
6061
61
-On SPARC - You press :kbd:`ALT-STOP-<command key>`, I believe.
62
+On SPARC
63
+ You press :kbd:`ALT-STOP-<command key>`, I believe.
6264
6365 On the serial console (PC style standard serial ports only)
6466 You send a ``BREAK``, then within 5 seconds a command key. Sending
6567 ``BREAK`` twice is interpreted as a normal BREAK.
6668
6769 On PowerPC
68
- Press :kbd:`ALT - Print Screen` (or :kbd:`F13`) - :kbd:`<command key>`,
70
+ Press :kbd:`ALT - Print Screen` (or :kbd:`F13`) - :kbd:`<command key>`.
6971 :kbd:`Print Screen` (or :kbd:`F13`) - :kbd:`<command key>` may suffice.
7072
7173 On other
....@@ -73,9 +75,11 @@
7375 let me know so I can add them to this section.
7476
7577 On all
76
- write a character to /proc/sysrq-trigger. e.g.::
78
+ Write a character to /proc/sysrq-trigger. e.g.::
7779
7880 echo t > /proc/sysrq-trigger
81
+
82
+The :kbd:`<command key>` is case sensitive.
7983
8084 What are the 'command' keys?
8185 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....@@ -171,22 +175,20 @@
171175 useful when you want to exit a program that will not let you switch consoles.
172176 (For example, X or a svgalib program.)
173177
174
-``reboot(b)`` is good when you're unable to shut down. But you should also
175
-``sync(s)`` and ``umount(u)`` first.
178
+``reboot(b)`` is good when you're unable to shut down, it is an equivalent
179
+of pressing the "reset" button.
176180
177181 ``crash(c)`` can be used to manually trigger a crashdump when the system is hung.
178182 Note that this just triggers a crash if there is no dump mechanism available.
179183
180
-``sync(s)`` is great when your system is locked up, it allows you to sync your
181
-disks and will certainly lessen the chance of data loss and fscking. Note
182
-that the sync hasn't taken place until you see the "OK" and "Done" appear
183
-on the screen. (If the kernel is really in strife, you may not ever get the
184
-OK or Done message...)
184
+``sync(s)`` is handy before yanking removable medium or after using a rescue
185
+shell that provides no graceful shutdown -- it will ensure your data is
186
+safely written to the disk. Note that the sync hasn't taken place until you see
187
+the "OK" and "Done" appear on the screen.
185188
186
-``umount(u)`` is basically useful in the same ways as ``sync(s)``. I generally
187
-``sync(s)``, ``umount(u)``, then ``reboot(b)`` when my system locks. It's saved
188
-me many a fsck. Again, the unmount (remount read-only) hasn't taken place until
189
-you see the "OK" and "Done" message appear on the screen.
189
+``umount(u)`` can be used to mark filesystems as properly unmounted. From the
190
+running system's point of view, they will be remounted read-only. The remount
191
+isn't complete until you see the "OK" and "Done" message appear on the screen.
190192
191193 The loglevels ``0``-``9`` are useful when your console is being flooded with
192194 kernel messages you do not want to see. Selecting ``0`` will prevent all but
....@@ -231,13 +233,13 @@
231233 handler is called. Your handler must conform to the prototype in 'sysrq.h'.
232234
233235 After the ``sysrq_key_op`` is created, you can call the kernel function
234
-``register_sysrq_key(int key, struct sysrq_key_op *op_p);`` this will
236
+``register_sysrq_key(int key, const struct sysrq_key_op *op_p);`` this will
235237 register the operation pointed to by ``op_p`` at table key 'key',
236238 if that slot in the table is blank. At module unload time, you must call
237
-the function ``unregister_sysrq_key(int key, struct sysrq_key_op *op_p)``, which
238
-will remove the key op pointed to by 'op_p' from the key 'key', if and only if
239
-it is currently registered in that slot. This is in case the slot has been
240
-overwritten since you registered it.
239
+the function ``unregister_sysrq_key(int key, const struct sysrq_key_op *op_p)``,
240
+which will remove the key op pointed to by 'op_p' from the key 'key', if and
241
+only if it is currently registered in that slot. This is in case the slot has
242
+been overwritten since you registered it.
241243
242244 The Magic SysRQ system works by registering key operations against a key op
243245 lookup table, which is defined in 'drivers/tty/sysrq.c'. This key table has
....@@ -284,7 +286,7 @@
284286 Credits
285287 ~~~~~~~
286288
287
-Written by Mydraal <vulpyne@vulpyne.net>
288
-Updated by Adam Sulmicki <adam@cfar.umd.edu>
289
-Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
290
-Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>
289
+- Written by Mydraal <vulpyne@vulpyne.net>
290
+- Updated by Adam Sulmicki <adam@cfar.umd.edu>
291
+- Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
292
+- Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>