ctrl-alt-del

Mark Musone mmusone at shatterit.com
Tue Nov 16 09:08:48 EST 2004


Good point..forgot about that..
Thanks

-Mark


-----Original Message-----
From: owner-nflug at nflug.org [mailto:owner-nflug at nflug.org] On Behalf Of
Mark T. Valites
Sent: Tuesday, November 16, 2004 8:59 AM
To: nflug at nflug.org
Subject: RE: ctrl-alt-del

On Tue, 16 Nov 2004, Mark Musone wrote:

> That's funny..i kinda like it because it gives the ability to cleanly
> shut down a server that's gone crazy with load or other reasons
(library
> problems..etc..) that would otherwise make it impossible to actually
log
> in to the console..it's as close as possible to the good old STOP-A
sync
> sync sync :)

You want to take a look at the magic sys req key combo.

You can find additional information in Documentation/sysrq.txt of your
kernel source. If you can read it with the ugly line wrapping below,
here's what you'll find in that file:

Now I've got a rogue DHCP server in our wireless network to find...


*  What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is a 'magical' key combo you can hit which the kernel will respond to
regardless of whatever else it is doing, unless it is completely locked
up.

*  How do I enable the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
configuring the kernel. When running on a kernel with SysRq compiled in,
it
may be DISABLED at run-time using following command:

        echo "0" > /proc/sys/kernel/sysrq

Note that previous versions disabled sysrq by default, and you were
required
to specifically enable it at run-time. That is not the case any longer.


*  How do I use the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On x86   - You press the key combo 'ALT-SysRq-<command key>'. Note -
Some
           keyboards may not have a key labeled 'SysRq'. The 'SysRq' key
is
           also known as the 'Print Screen' key. Also some keyboards
cannot
           handle so many keys being pressed at the same time, so you
might
           have better luck with "press Alt", "press SysRq", "release
Alt",
           "press <command key>", release everything.


*  What are the 'command' keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'r'     - Turns off keyboard raw mode and sets it to XLATE.

'k'     - Secure Access Key (SAK) Kills all programs on the current
virtual
          console. NOTE: See important comments below in SAK section.

'b'     - Will immediately reboot the system without syncing or
unmounting
          your disks.

'o'     - Will shut your system off (if configured and supported).

's'     - Will attempt to sync all mounted filesystems.

'u'     - Will attempt to remount all mounted filesystems read-only.

'p'     - Will dump the current registers and flags to your console.

't'     - Will dump a list of current tasks and their information to
your
          console.
'm'     - Will dump current memory info to your console.

'v'     - Dumps Voyager SMP processor info to your console.

'0'-'9' - Sets the console log level, controlling which kernel messages
          will be printed to your console. ('0', for example would make
          it so that only emergency messages like PANICs or OOPSes would
          make it to your console.)

'e'     - Send a SIGTERM to all processes, except for init.

'i'     - Send a SIGKILL to all processes, except for init.

'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
          will be non-functional after this.)

'h'     - Will display help ( actually any other key than those listed
          above will display help. but 'h' is easy to remember :-)


*  Okay, so what can I use them for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, un'R'aw is very handy when your X server or a svgalib program
crashes.

sa'K' (Secure Access Key) is useful when you want to be sure there are
no
trojan program is running at console and which could grab your password
when you would try to login. It will kill all programs on given console
and thus letting you make sure that the login prompt you see is actually
the one from init, not some trojan program.
IMPORTANT:In its true form it is not a true SAK like the one in
:IMPORTANT
IMPORTANT:c2 compliant systems, and it should be mistook as such.
:IMPORTANT
       It seems other find it useful as (System Attention Key) which is
useful when you want to exit a program that will not let you switch
consoles.
(For example, X or a svgalib program.)

re'B'oot is good when you're unable to shut down. But you should also
'S'ync
and 'U'mount first.

'S'ync is great when your system is locked up, it allows you to sync
your
disks and will certainly lessen the chance of data loss and fscking.
Note
that the sync hasn't taken place until you see the "OK" and "Done"
appear
on the screen. (If the kernel is really in strife, you may not ever get
the
OK or Done message...)
'U'mount is basically useful in the same ways as 'S'ync. I generally
'S'ync,
'U'mount, then re'B'oot when my system locks. It's saved me many a fsck.
Again, the unmount (remount read-only) hasn't taken place until you see
the
"OK" and "Done" message appear on the screen.

The loglevel'0'-'9' is useful when your console is being flooded with
kernel messages you do not want to see. Setting '0' will prevent all but
the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.)

t'E'rm and k'I'll are useful if you have some sort of runaway process
you
are unable to kill any other way, especially if it's spawning other
processes.


-- 
Mark T. Valites
Unix Systems Analyst
Computing & Information Technology
SUNY Geneseo
>--))> >--))>






More information about the nflug mailing list