Re: Remotely rebooting a machine with state 'D' processes, how?

From: Axel Thimm (Axel.Thimm@physik.fu-berlin.de)
Date: Sat Aug 11 2001 - 02:26:23 EST


On Fri, Aug 10, 2001 at 02:59:37PM -0700, Linus Torvalds wrote:
> In article <20010810231906.A21435@bonzo.nirvana> you write:
> > How can I reboot a stuck machine remotely, when there are uninterruptable
> > processes arround? shutdown -r, reboot [-n] [-f], telinit 6 do not give
> > the intended results. Localy I can use Alt-SysRq-S/U/B, but what if I
> > still have a remote ssh connection and don't want to have to get to the
> > machines location?
> >
> > Of course the real problem are the processes themselves, but being able to
> > revive a machine is also nice ;)
> You have to use the reboot() system call directly as root, with the proper
> arguments to make it avoid doing even any sync. See man 2 reboot for
> details.

Would there be a way to also simulate the effects of Alt-SysRq-S and
Alt-SysRq-U? A simple sync falls also into D-state, Alt-SysRq-S does not, as
far as I have had to use it.

Would an `emergency-reboot' binary that calls these three kernel calls be
possible and also good-to-have if it's not a too bad idea?

Is there a way to have this automated in some kind of a kernel software
watchdog? Given certain conditions (like processes in D-state for longer than
a specified time) the kernel might first try to call a userland-reboot and
this timing out the kernel might use the sync;umount;reboot procedure of
Alt-SysRq-S/U/B.

But even when I write this I realize the security hole potentials. If someone
could simulate the watchdog conditions for a reboot, he might be able to have
this machine reboot all the time.

-- 
Axel.Thimm@physik.fu-berlin.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 15 2001 - 21:00:37 EST