Is there any way that this can be triggered remotely? I frequently get
into situations with a particular machine where 'reboot' or 'reboot -f'
just plain won't work, and would like to be able do a 'filesystem clean'
forcible reboot, but don't particularly care about services being shut
down cleanly. Of course, the key is, I'm not at the keyboard of the
server in question.
I figured there may be some way to have a module do this, but if anyone
has any ideas, I'd appreciate it. I did see the example sent not too
long ago about triggering a panic, but that won't cleanly unmount the
filesystems.
-- Nathan
------------------------------------------------------------
Nathan Neulinger EMail: [email protected]
University of Missouri - Rolla Phone: (573) 341-4841
CIS - Systems Programming Fax: (573) 341-4216
On Sun, 25 Mar 2001 10:27:28 -0600,
Nathan Neulinger <[email protected]> wrote:
>Is there any way that this can be triggered remotely? I frequently get
>into situations with a particular machine where 'reboot' or 'reboot -f'
>just plain won't work, and would like to be able do a 'filesystem clean'
>forcible reboot, but don't particularly care about services being shut
>down cleanly. Of course, the key is, I'm not at the keyboard of the
>server in question.
If you have a serial console on the server, you can get sysrq by
sending a serial break followed by the character. See
drivers/char/serial.c on any 2.4 kernel. Otherwise you could hack up a
module that calls handle_sysrq() directly. Unless you are sending a
character that needs regs ('p'), kbd ('r') or tty ('k'), you can set
those parameters to NULL. Any unrecognised character will try to use
kbd and tty parameters.
Hi Nathan,
I've just made an experimental module which offers syscall to privileged
process, which internally translates itself into real sysrq handler
(handle_sysrq) defined in drivers/char/sysrq.c. It occupates itself
one of unussed linux system calls (concretely stty - no. 31).
Makefile and patch for that sysrq.c are included in attached archive.
(I stronly believe i didn't made it reversed :).
The patch itself only exports 1 variable and 1 function from sysrq.c,
that normally aren't.
You can make a daemon, which listens on socket and triggers commands
send by clients. Dont call sysrq+boot until a while needed to sync and
unmount. This check, if sync and/or umount were finished before boot,
should be really done, but it would require more changes in kernel
source. And of course, the security is to be taken in client/server
into account.
Bye B.
> If you have a serial console on the server, you can get sysrq by
> sending a serial break followed by the character.
Hi,
i've tried it with minicom and functioned : ctrl+a+F and key for function
as in normal sysrq.
This approach will probably not help you a lot thought, since you wouldn't
have access to your serial console too.
If you don't get your problems solved till now, i could make a simple
single-purpos module which will export a syscall to priviledged process
to call sysrq functions.
Gonna to have a look...
Bye B.