[systemd-devel] [PATCH 3/4] Adding halt binary to shutdown the system

Lennart Poettering lennart at poettering.net
Fri Oct 1 10:53:13 PDT 2010


1;2591;0cOn Fri, 01.10.10 07:11, Andrey Borzenkov (arvidjaar at mail.ru) wrote:

> > - Call shutdown
> > If one step fail, shutdown will be aborted
> May we have them as three different units, please?
> - killall
> - umountall
> - shutdown

I don't think we want that, as Gustavo already pointed out.

> There could be alternative shutdown methods (like kexec) desired; also there
> may be extra tasks to do between umounting and shutdown, like calling UPS
> switch off command.

I am not sure stuff like UPS switch off really makes sense since it is
inherenlty racy. How is that ever supposed to work? How would we from
userspace know when exactly the kernel is finished shutting down? And
even if we knew how would we tell anybody about this since at this time
the kernel is already stopped and userspace would have ceased to
exist...

Note that the kernel does number of things when going down, such as
syncing and more. Since that is the case it must also be the kernel
which afterwards talks to the UPS. Shutting down UPS from userspace is
just racy, as the power might go away at a time the kernel is still busy
with stuff.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list