Re: Minor request for enhancement: "beep on halt"

Richard Gooch (rgooch@atnf.csiro.au)
Mon, 14 Dec 1998 18:35:32 +1100


Jason A. Pfeil writes:
> Not quite. Shutdown(8) is a user-space program and as such exits when the
> kernel shuts down all processes before unmounting the filesystems.
> Shutdown just calls a routine in the kernel to handle the shutdown before
> it is killed itself. Therefore, this ability needs to be in the kernel
> proper.
>
> On Mon, 14 Dec 1998, Richard Gooch wrote:
>
> > Stephen Harris writes:
> > > Well, Alan Cox reckons my original patch was in the right place, so
> > > here's a version against 2.1.131. This is a lot better, because the
> > > shutdown code has been seperated out between the architectures, so
> > > I'm not too worried that this is intel only code... after all, it
> > > now lives in arch/i386 :-)
> >
> > Perhaps I missed it, but why can't you hack shutdown(8) to beep after
> > you've unmounted and synced? shutdown(8) already knows when it is safe
> > to turn the power off.

Sorry, I don't agree. The shutdown(8) programme is what kills all
processes, unmounts filesystems, remounts the root FS read-only, syncs
the discs and then calls reboot(2) which halts/reboots.

I'm pretty sure about this: I recently hacked shutdown(8) from
util-linux (check out util-linux-2.9) to add support for a userspace
power off facility. Once it's safe, it can exec another programme to
do whatever you like (in my case it talks to some special hardware
which turns off my machine).

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/