From 9c903b95340c95b2b3214935fd93a04f226a1e73 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 2 Apr 2015 13:36:48 +0100 Subject: [PATCH] system bus: do not allow stopping the system dbus-daemon There is nothing that prevents D-Bus from stopping very early, way earlier than all of the Type=dbus services. There is an attempt to prevent that as systemd implies "After=dbus.socket" for Type=dbus units, but that doesn't save us: you can't re-start D-Bus after shutting it down and expect things to just work, as it loses all of its state. Putting dbus.service Before basic.target was considered and rejected, because it's a recipe for cyclic dependencies: as soon as dbus.service wants to be After anything that is After basic.target (e.g. NIS and other user databases, or remote filesystems) you get a cycle. dbus-daemon does not need to start early, it only needs to stop late. systemd has a final killing spree before it unmounts the file systems, which should be sufficient to avoid dbus-daemon preventing a separate /usr from being unmounted; this does not consider KillMode. dbus-daemon doesn't need to do anything special during shutdown, so it's OK that it survives until then. Based on a suggestion from Michael Biebl and Martin Pitt. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89847 --- bus/dbus.service.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bus/dbus.service.in b/bus/dbus.service.in index 3bc4726..dd66f70 100644 --- a/bus/dbus.service.in +++ b/bus/dbus.service.in @@ -6,4 +6,6 @@ Requires=dbus.socket [Service] ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation ExecReload=@EXPANDED_BINDIR@/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig +ExecStop=/bin/echo "Stopping the system dbus-daemon is not supported. Reboot the system instead." +KillMode=none OOMScoreAdjust=-900 -- 2.1.4