From 337387ac7b444afa1c267479be25536387bd3392 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Oct 22 2018 07:58:23 +0000 Subject: dbus: move systemd-hooks for dbus.socket to 'dbus-common' The systemd_{post,postun,preun,..} hooks should be called in the package that actually provides the given files. There is no harm in calling these in the dbus-daemon package, but preferably we don't. Move this to 'dbus-common' for dbus.socket, since dbus.socket is provided by it. This makes sure the unit is properly enabled/disabled even without the dbus-daemon package installed. Note that it is safe to enable/disable dbus.socket even without a dbus.service around. systemd can deal with this just fine, and only ever actually pulls in the socket if an activatable service is around. Signed-off-by: David Herrmann --- diff --git a/dbus.spec b/dbus.spec index 132b1f1..2c77982 100644 --- a/dbus.spec +++ b/dbus.spec @@ -310,19 +310,31 @@ popd /usr/sbin/useradd -c 'System message bus' -u %{dbus_user_uid} -g %{dbus_user_uid} \ -s /sbin/nologin -r -d '/' dbus 2> /dev/null || : +%post common +%systemd_post dbus.socket +%systemd_user_post dbus.socket + %post daemon -%systemd_post dbus-daemon.service dbus.socket -%systemd_user_post dbus-daemon.service dbus.socket +%systemd_post dbus-daemon.service +%systemd_user_post dbus-daemon.service %post libs -p /sbin/ldconfig +%preun common +%systemd_preun dbus.socket +%systemd_user_preun dbus.socket + %preun daemon -%systemd_preun dbus-daemon.service dbus.socket -%systemd_user_preun dbus-daemon.service dbus.socket +%systemd_preun dbus-daemon.service +%systemd_user_preun dbus-daemon.service + +%postun common +%systemd_postun dbus.socket +%systemd_user_postun dbus.socket %postun daemon -%systemd_postun dbus-daemon.service dbus.socket -%systemd_user_postun dbus-daemon.service dbus.socket +%systemd_postun dbus-daemon.service +%systemd_user_postun dbus-daemon.service %postun libs -p /sbin/ldconfig