[systemd-devel] Synchronization Between Services at Shutdown

Martin Pitt martin.pitt at ubuntu.com
Thu Apr 2 07:28:32 PDT 2015


Lennart Poettering [2015-04-02 13:03 +0200]:
> Yeah, and rightfully so. I mean, a service really should be able to
> shutdown if dbus is dead. In fact, it should be able to shutdown in
> pretty much any situation...

They do, but that's irrelevant here. The problem is that dbus.service
shuts down very early as nothing prevents it from that. All
dependencies just refer to dbus.socket, but TBH socket (re-)activation
totally doesn't work for dbus. On restarts it forgets all of its
previous state/connections, so a service which still needs to talk to
dbus during shutdown will just fail if dbus.service already stopped.

So what happens is that dbus.service gets stopped early, takes
NetworkManager, wpasupplicant etc. with it, and then the network
mounts can't be unmounted any more as the network is already down
(which isn't intended at this point yet, as network.target is still
active).

Synthesizing After=dbus.service dependencies instead of dbus.socket
ones for Type=dbus would help, as then you'd have the ordering which
prevents dbus.service from going down early. But this is prone to
dependency loops.

This has also been discussed with upstream on
https://bugs.freedesktop.org/show_bug.cgi?id=89847

I don't really have a good solution, the "don't really stop dbus" is a
relatively safe hack that's appropriate for the "we need to release in
two weeks" freeze. Obviously the really good solution is to get kdbus,
then dbus will always be available :-)

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list