Alt + sysrq + reisub не перезагружает мой ноутбук

Содержание

Что такое sysrq?
Почему RESIUB (O) не работает?

1 Как заставить sysrq вести себя так, как я хочу? 1.1 Что такое волшебный ключ SysRq? 1.2 strong> Как включить волшебный ключ SysRq? 1.3 Как использовать волшебный ключ SysRq? 1.4 Что такое ключи команды? 1.5 Хорошо, поэтому для чего я могу их использовать?

1.6 Устранение неполадок

1.6.1 Повреждение перед запуском initscripts 1.6.2 Иногда SysRq, кажется, «застревает» после его использования, что я могу сделать? > 1.6.3 Я попал в SysRq, но ничего не происходит, что не так? 1.6.4 Я хочу добавить ключевые события SysRQ в модуль, как это сделать это работает? 1.6.5 Заключение 1.6.6 ПРИЛОЖЕНИЕ Примечание.
Вы можете использовать Ctrl + F , чтобы использовать Оглавление.

When I hit a SysRq key combination only the header appears on the console?¶

Sysrq output is subject to the same console loglevel control as all
other console output. This means that if the kernel was booted ‘quiet’
as is common on distro kernels the output may not appear on the actual
console, even though it will appear in the dmesg buffer, and be accessible
via the dmesg command and to the consumers of . As a specific
exception the header line from the sysrq command is passed to all console
consumers as if the current loglevel was maximum. If only the header
is emitted it is almost certain that the kernel loglevel is too low.
Should you require the output on the console channel then you will need
to temporarily up the console loglevel using alt-sysrq-8 or:

echo 8 > /proc/sysrq-trigger

Пыль веков

  • ► 

    (4)

    ► 

    июля
    (1)

    ► 

    июня
    (1)

    ► 

    февраля
    (1)

    ► 

    января
    (1)

  • ► 

    (22)

    ► 

    декабря
    (1)

    ► 

    ноября
    (1)

    ► 

    октября
    (2)

    ► 

    сентября
    (2)

    ► 

    августа
    (1)

    ► 

    июля
    (1)

    ► 

    июня
    (2)

    ► 

    мая
    (2)

    ► 

    апреля
    (3)

    ► 

    марта
    (3)

    ► 

    февраля
    (2)

    ► 

    января
    (2)

  • ► 

    (29)

    ► 

    декабря
    (3)

    ► 

    ноября
    (2)

    ► 

    октября
    (2)

    ► 

    сентября
    (2)

    ► 

    августа
    (4)

    ► 

    июля
    (3)

    ► 

    июня
    (2)

    ► 

    мая
    (2)

    ► 

    апреля
    (2)

    ► 

    марта
    (2)

    ► 

    февраля
    (2)

    ► 

    января
    (3)

  • ► 

    (27)

    ► 

    декабря
    (2)

    ► 

    ноября
    (3)

    ► 

    октября
    (2)

    ► 

    сентября
    (2)

    ► 

    августа
    (2)

    ► 

    июля
    (2)

    ► 

    июня
    (2)

    ► 

    мая
    (2)

    ► 

    апреля
    (3)

    ► 

    марта
    (3)

    ► 

    февраля
    (2)

    ► 

    января
    (2)

  • ► 

    (31)

    ► 

    декабря
    (3)

    ► 

    ноября
    (2)

    ► 

    октября
    (3)

    ► 

    сентября
    (3)

    ► 

    августа
    (4)

    ► 

    июля
    (3)

    ► 

    июня
    (2)

    ► 

    мая
    (2)

    ► 

    апреля
    (3)

    ► 

    марта
    (2)

    ► 

    февраля
    (2)

    ► 

    января
    (2)

  • ► 

    (35)

    ► 

    декабря
    (2)

    ► 

    ноября
    (3)

    ► 

    октября
    (2)

    ► 

    сентября
    (3)

    ► 

    августа
    (3)

    ► 

    июля
    (2)

    ► 

    июня
    (3)

    ► 

    мая
    (3)

    ► 

    апреля
    (5)

    ► 

    марта
    (4)

    ► 

    февраля
    (2)

    ► 

    января
    (3)

  • ► 

    (64)

    ► 

    декабря
    (6)

    ► 

    ноября
    (4)

    ► 

    октября
    (3)

    ► 

    сентября
    (4)

    ► 

    августа
    (5)

    ► 

    июля
    (6)

    ► 

    июня
    (7)

    ► 

    мая
    (7)

    ► 

    апреля
    (6)

    ► 

    марта
    (6)

    ► 

    февраля
    (4)

    ► 

    января
    (6)

  • ► 

    (91)

    ► 

    декабря
    (7)

    ► 

    ноября
    (7)

    ► 

    октября
    (5)

    ► 

    сентября
    (11)

    ► 

    августа
    (5)

    • ► 

      июля
      (8)

    ► 

    июня
    (11)

    ► 

    мая
    (6)

    ► 

    апреля
    (6)

    ► 

    марта
    (5)

    ► 

    февраля
    (12)

    ► 

    января
    (8)

  • ► 

    (59)

    ► 

    декабря
    (10)

    ► 

    ноября
    (9)

    ► 

    октября
    (9)

    ► 

    сентября
    (9)

    ► 

    августа
    (13)

    ► 

    июля
    (9)

When I hit a SysRq key combination only the header appears on the console?¶

Sysrq output is subject to the same console loglevel control as all
other console output. This means that if the kernel was booted ‘quiet’
as is common on distro kernels the output may not appear on the actual
console, even though it will appear in the dmesg buffer, and be accessible
via the dmesg command and to the consumers of . As a specific
exception the header line from the sysrq command is passed to all console
consumers as if the current loglevel was maximum. If only the header
is emitted it is almost certain that the kernel loglevel is too low.
Should you require the output on the console channel then you will need
to temporarily up the console loglevel using or:

echo 8 > /proc/sysrq-trigger

Выключение

Как можно выключить режим SysRq? В документации (sysrq.txt) нет
ничего определенного на этот счёт. Там говорится насчёт нажатия
левого и правого Ctrl, клавиш Alt и Shift, но у меня работает более
простой способ. Просто нажмите Alt+SysRq ещё раз, и вы выйдете из
этого режима.

Что я понял: ядро запоминает состояние волшебной SysRq: нажато
или отпущено. Когда вы нажимаете клавишу первый раз, состояние
изменяется на нажатое. А когда вы нажимаете любую клавишу, пока
SysRq нажата, ядро интерпретирует её как команду. Если вы нажимаете
SysRq ещё раз, её состояние изменится на отпущенное, и дальнейшие
нажатия клавиш обрабатываются так, как этого требует программа.
(Вообще-то, это не так просто. Иногда вышеупомянутый метод не
работает. Думаю, это потому, что ядро использует отдельные таблицы
трансляции кодов, когда волшебная SysRq нажата.)

Клавиша SysRq изначально означала, как вы можете догадаться,
«Системный Запрос». Она использовалась на первых терминалах IBM для
запроса центрального компьютера выполнить команду. Эта клавиша
теперь редко где используется, кроме, пожалуй, ядра Linux.

И как это использовать?

Волшебная SysRq вызывается как < Alt+SysRq > + <
клавиша >. (Напоминаю, что клавиша SysRq также обозначается как
Print Screen). В сочетании с < Alt+SysRq > можно использовать
следующие клавиши:

k: Клавиша безопасного доступа. Она убивает все процессы,
запущенные на текущей виртуальной консоли, так, чтобы никакая
излишне любопытная программа не могла захватить ваши нажатия
клавиш, в то время как Вы печатаете ваш пароль.

u: Попытка отмонтировать корневую файловую систему («/») и
перемонтировать её в режиме только-для-чтения. В
дополнение к экстренному выключению, эта команда может пригодится,
если у вас в Linux только один раздел и необходимо выполнить fsck
или низкоуровневое редактирование файловой системы (например,
восстановление удалённых файлов на файловой системе ext2. Смотрите
Ext2fs
Undeletion Howto (Прим.ред. — чтобы восстановить удалённые
файлы на ФС ext3 смонтируйте её как ext2.)

s: Эта команда сбрасывает содержимое буферов на диск. Это надо
сделать до размонтирования.

b: Производит непосредственную перезагрузку, прямо как кнопка
Reset. Для безопасного выключения необходимо предварительно
сбросить буферы и размонтировать систему.

p: Печатает содержимое регистров процессора.(Прим.перев. — право, мне, как программисту, непонятно —
зачем? Они ведь меняются с бешеной скоростью.)
(Прим.ред. — согласен

Обращаю ваше внимание, что информация
пишется в системные логи.)

m: Отображает информацию о памяти.

t: Отображает информацию о запущенных задачах.

0-9: Устанавливает указанный уровень вывода отладочной
информации для консоли.

e: Посылает сигнал SIGTERM (приказ завершить работу) всем
процессам кроме init.

i: Посылает сигнал SIGKILL(безусловное завершение) всем
процессам кроме init.

l: Посылает сигнал SIGKILL всем процессам, включая init (вы
ничего не сможете сделать после этого).

‘r’ — переключает клавиатуру из режима скан-кодов (raw mode) и
устанавливает в режим XLATE (8-битный ASCII режим) (Прим.перев.
— более подробно о режимах клавиатуры читайте в man kbd_mode или в
FAQ console-tools).

‘h’ — Отображает помощь (на самом деле, любая другая клавиша,
кроме указанных выше, вызовет справку. Но ‘h’ проще запомнить
🙂

I want to add SysRQ key events to a module, how does it work?¶

In order to register a basic function with the table, you must first include
the header , this will define everything else you need.
Next, you must create a struct, and populate it with A) the key
handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in ‘sysrq.h’.

After the is created, you can call the kernel function
this will
register the operation pointed to by at table key ‘key’,
if that slot in the table is blank. At module unload time, you must call
the function , which
will remove the key op pointed to by ‘op_p’ from the key ‘key’, if and only if
it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it.

The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in ‘drivers/tty/sysrq.c’. This key table has
a number of operations registered into it at compile time, but is mutable,
and 2 functions are exported for interface to it:

register_sysrq_key and unregister_sysrq_key.

Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. 🙂

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 a kernel with SysRq compiled in,
/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
the SysRq key. The default value in this file is set by the
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults
to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:

You can set the value in the file by the following command:

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

The number may be written here either as decimal or as hexadecimal
with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be
written in hexadecimal.

Other ways to invoke Magic SysRq

While the magic SysRq key was originally implemented as part of the kernel’s keyboard handler for debugging, the functionality has been also exposed via the proc filesystem and is commonly used to provide extended management capabilities to headless and remote systems. From user space programs (such as a command line shell), SysRq may be accessed by writing to /proc/sysrq-trigger (e.g., ).

Many embedded systems have no attached keyboard, but instead use a serial console for text input/output to the running system. It is possible to invoke a Magic SysRq feature over a serial console by sending a , followed by the desired key. The method of sending a break is dependent on the terminal program or hardware used to connect to the serial console. A sysctl option needs to be set to enable this function.

The Linux daemons sysrqd and tcpconsole provide a method of accessing SysRq features over a TCP connection after authenticating with a plain-text password. The hangwatch daemon will invoke pre-configured SysRq triggers when system load average exceeds a certain threshold.

The Xen hypervisor has functionality to send magic commands to hosted domains via its xm sysrq command. Additionally, a SysRq command can be invoked from a Xen paravirtual console by sending a break sequence Ctrl+O followed by the desired key.

Chromebooks have a keyboard but no dedicated SysRq key. They use Alt+VolumeUp (Alt+F10) instead, however some keys have a different function.

IBM Power Systems servers can invoke the Magic SysRq feature using Ctrl+O followed by the desired key from the Hardware Management Console.

IBM mainframe partitions can invoke the Magic SysRq feature using ^+- followed by the desired key on or HMC console.

I want to add SysRQ key events to a module, how does it work?¶

In order to register a basic function with the table, you must first include
the header , this will define everything else you need.
Next, you must create a struct, and populate it with A) the key
handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in ‘sysrq.h’.

After the is created, you can call the kernel function
this will
register the operation pointed to by at table key ‘key’,
if that slot in the table is blank. At module unload time, you must call
the function , which
will remove the key op pointed to by ‘op_p’ from the key ‘key’, if and only if
it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it.

The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in ‘drivers/tty/sysrq.c’. This key table has
a number of operations registered into it at compile time, but is mutable,
and 2 functions are exported for interface to it:

register_sysrq_key and unregister_sysrq_key.

Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. 🙂

I want to add SysRQ key events to a module, how does it work?¶

In order to register a basic function with the table, you must first include
the header , this will define everything else you need.
Next, you must create a struct, and populate it with A) the key
handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in ‘sysrq.h’.

After the is created, you can call the kernel function
this will
register the operation pointed to by at table key ‘key’,
if that slot in the table is blank. At module unload time, you must call
the function , which
will remove the key op pointed to by ‘op_p’ from the key ‘key’, if and only if
it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it.

The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in ‘drivers/tty/sysrq.c’. This key table has
a number of operations registered into it at compile time, but is mutable,
and 2 functions are exported for interface to it:

register_sysrq_key and unregister_sysrq_key.

Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. 🙂

Okay, so what can I use them for?¶

Well, unraw(r) is very handy when your X server or a svgalib program crashes.

sak(k) (Secure Access Key) is useful when you want to be sure there is no
trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console,
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 a
c2 compliant system, and it should not be mistaken as
such.

It seems others 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.)

is good when you’re unable to shut down. But you should also
and first.

can be used to manually trigger a crashdump when the system is hung.
Note that this just triggers a crash if there is no dump mechanism available.

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…)

is basically useful in the same ways as . I generally
, , then 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 loglevels — are useful when your console is being flooded with
kernel messages you do not want to see. Selecting will prevent all but
the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.)

and 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.

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 a kernel with SysRq compiled in,
/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
the SysRq key. The default value in this file is set by the
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults
to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:

You can set the value in the file by the following command:

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

The number may be written here either as decimal or as hexadecimal
with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be
written in hexadecimal.

Uses

A common use of the magic SysRq key is to perform a safe reboot of a Linux computer which has otherwise locked up (abbr. REISUB). This can prevent a fsck being required on reboot and gives some programs a chance to save emergency backups of unsaved work. The QWERTY (or AZERTY) mnemonics: «Raising Elephants Is So Utterly Boring», «Reboot Even If System Utterly Broken» or simply the word «BUSIER» read backwards, are often used to remember the following SysRq-keys sequence:

  • 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 except init, forcing them to terminate immediately),
  • Sync (flush data to disk),
  • Unmount (remount all filesystems read-only),
  • reBoot.

When magic SysRq keys are used to kill a frozen graphical program, the program has no chance to restore text mode. This can make everything unreadable. The commands textmode (part of SVGAlib) and the reset command can restore text mode and make the console readable again.

On distributions that do not include a textmode command, the key command Ctrl+Alt+F1 may sometimes be able to force a return to a text console. (Use F1, F2, F3, … , Fn, where n is the highest number of text consoles set up by the distribution. Ctrl+Alt+F(n+1) would normally be used to reenter GUI mode on a system on which the X server has not crashed.) There are also distributions where Ctrl+Alt + (F3, … ,F(n-2)) opens text consoles, Ctrl+Alt+F1 reenter GUI mode, Ctrl+Alt+F2 reenter GUI mode on the login page, in order to log in another user.

Включить

Чтобы сделать доступной волшебную комбинацию SysRq, ваше ядро
должно быть скомпилировано с опцией CONFIG_MAGIC_SYSRQ. Большинство
дистрибутивов по умолчанию включают её. Если же это не так, то вам
надо его просто перекомпилировать… 🙂

[Прим.ред. — это автор так шутит. Вряд ли сборку ядра можно
отнести к категории «просто». 😉 Но, как правило, создатели
дистрибутивов включают эту опцию. А теперь то, что касается
собственно пересборки. В настоящий момент Kernel-HOWTO находится на
пересмотре. Этим занимается Kwan Lowe. В дальнейшем документ будет
называться Kernel Rebuild Guide. Более-менее законченный вариант в
настоящий момент доступен по адресу
http://www.digitalhermit.com/~kwan/kernel.html
К этому можно добавить, что Brian Ward, автор оригинального Kernel
HOWTO, планирует опубликовать альтернативную версию этого
документа.]

После того, как закончите с ядром, проверьте — разрешена ли
SysRq по умолчанию.

$ cat /proc/sys/kernel/sysrq
0

Если вы видите 0 — значит не разрешена. Запишите любое ненулевое
число в файл /proc/sys/kernel/sysrq, чтобы разрешить её.

$ echo "1" > /proc/sys/kernel/sysrq

Для того чтобы она всегда была разрешена, добавьте эти строки в
один из ваших инициализационных скриптов (предпочтительно в
rc.local).

#Enable SysRq
echo -e "Enabling SysRq\n"
echo "1" > /proc/sys/kernel/sysrq

Как альтернативный вариант вы можете использовать файл
/etc/sysctl или /etc/sysctl.conf, если такой присутствует в вашем
дистрибутиве (например, у меня в RedHat такой файл есть). Для
включения sysrq добавьте в него следующую строку:

kernel.sysrq = 1

Волшебная комбинация SysRq уникальна. Каждая клавиша при нажатии
или отпускании генерирует код, называемый скан-кодом. Не смотря на
то, что для волшебной комбинации SysRq используется две клавиши
(Alt+SysRq), посылается только один скан-код (0x54,
десятичное 84). Можете проверить это при помощи команды
.

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 a kernel with SysRq compiled in,
/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
the SysRq key. The default value in this file is set by the
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE config symbol, which itself defaults
to 1. Here is the list of possible values in /proc/sys/kernel/sysrq:

You can set the value in the file by the following command:

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

The number may be written here either as decimal or as hexadecimal
with the 0x prefix. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE must always be
written in hexadecimal.

I want to add SysRQ key events to a module, how does it work?¶

In order to register a basic function with the table, you must first include
the header , this will define everything else you need.
Next, you must create a struct, and populate it with A) the key
handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in ‘sysrq.h’.

After the is created, you can call the kernel function
this will
register the operation pointed to by at table key ‘key’,
if that slot in the table is blank. At module unload time, you must call
the function ,
which will remove the key op pointed to by ‘op_p’ from the key ‘key’, if and
only if it is currently registered in that slot. This is in case the slot has
been overwritten since you registered it.

The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in ‘drivers/tty/sysrq.c’. This key table has
a number of operations registered into it at compile time, but is mutable,
and 2 functions are exported for interface to it:

register_sysrq_key and unregister_sysrq_key.

Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. 🙂

Применение

В ОС Windows SysRq, нажатая вместе с Alt (т.е. PrtScr), копирует изображение активного окна в буфер обмена.

Компания Microsoft иногда использовала SysRq для различных отладчиков, как уровня ОС, так и уровня приложения. Некоторые версии отладчика CodeView использовали клавишу для прерывания программы во время исполнения и переключения в отладочный интерфейс. Удаленный отладчик ядра Windows NT использовал последовательность нажатий Ctrl+SysRq, Ctrl+SysRq для включения отладочного режима.

В ПК Hyundai/Hynix Super-16 нажатие Ctrl+SysRq приводит к холодной перезагрузке, в том числе, когда Ctrl+Alt+Del уже не работает.

Во встраиваемых системах изредка SysRq переключает сигнал RESET# в нижний уровень.

Безопасность

Делать доступной волшебную SysRq на работающей машине (сервере)
может быть потенциально опасным. Любой, у кого есть физический
доступ к машине, может «уронить» машину. Также необходимо запретить
SysRq, если другие люди могут удалённо зарегистрироваться на вашей
машине. Сигнал < break >, посланный с удалённой консоли,
будет интерпретирована как < Alt+SysRq >, и последствия могут
быть ужасны. Для получения дополнительной информации, смотрите Remote-Serial-Console-HOWTO.

(Прим.перев. — по адресу
http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/ru/html/
можно найти переводы на русский язык некоторых HOWTO. К сожалению
самые поздние из них датируются 2000-м годом, хотя большая часть из
них не потеряла своей актуальности и на сегодняшний день.)

Okay, so what can I use them for?¶

Well, unraw(r) is very handy when your X server or a svgalib program crashes.

sak(k) (Secure Access Key) is useful when you want to be sure there is no
trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console,
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 a
c2 compliant system, and it should not be mistaken as
such.

It seems others 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.)

is good when you’re unable to shut down, it is an equivalent
of pressing the “reset” button.

can be used to manually trigger a crashdump when the system is hung.
Note that this just triggers a crash if there is no dump mechanism available.

is handy before yanking removable medium or after using a rescue
shell that provides no graceful shutdown – it will ensure your data is
safely written to the disk. Note that the sync hasn’t taken place until you see
the “OK” and “Done” appear on the screen.

can be used to mark filesystems as properly unmounted. From the
running system’s point of view, they will be remounted read-only. The remount
isn’t complete until you see the “OK” and “Done” message appear on the screen.

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

and 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.

Okay, so what can I use them for?¶

Well, unraw(r) is very handy when your X server or a svgalib program crashes.

sak(k) (Secure Access Key) is useful when you want to be sure there is no
trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console,
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 a
c2 compliant system, and it should not be mistaken as
such.

It seems others 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.)

is good when you’re unable to shut down. But you should also
and first.

can be used to manually trigger a crashdump when the system is hung.
Note that this just triggers a crash if there is no dump mechanism available.

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…)

is basically useful in the same ways as . I generally
, , then 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 loglevels — are useful when your console is being flooded with
kernel messages you do not want to see. Selecting will prevent all but
the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.)

and 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.

Заключение

Хак волшебной SysRq иногда может быть очень удобным

Как бы то
ни было, пользуйтесь ею осторожно. Она также даёт вам немного
понимания внутренней работы ядра

Если пожелаете, то можете сами
добавить несколько команд!

Vikas G P

Я заканчиваю среднюю школу и живу в Хассане, штат Карнатака,
Индия, (Hassan, Karnataka in India) пытаюсь балансировать между
учёбой и изучением Linux.

Copyright (c) 2002, Vikas G P.
Copying license http://www.linuxgazette.com/copying.html

Published in Issue 81 of Linux Gazette, August
2002

http://gazette.linux.ru.net/lg81/vikas.html

[ опубликовано 18/08/2004 ]

Vikas G P. Перевод: Владимир Средних — SysRq: Убийца процессов

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector