From 42fa1404c94ced910761853ffa6de621eb325480 Mon Sep 17 00:00:00 2001 From: Marko Saukko Date: Tue, 10 Feb 2015 15:16:00 +0000 Subject: [PATCH] Prevent ssu startup when system is shutting down. [systemd] Prevent ssu startup when system is shutting down. Contributes to JB#24120 We need to map the dbus service file to systemd service file in order to be able to prevent dbus activation of the service when system is for example shutting down. Signed-off-by: Marko Saukko --- dbus/org.nemo.ssu.service | 6 ++++-- rpm/ssu.spec | 1 + ssud/ssud.pro | 5 ++++- systemd/dbus-org.nemo.ssu.service | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 systemd/dbus-org.nemo.ssu.service diff --git a/dbus/org.nemo.ssu.service b/dbus/org.nemo.ssu.service index 6207810..1ff91f1 100644 --- a/dbus/org.nemo.ssu.service +++ b/dbus/org.nemo.ssu.service @@ -1,5 +1,7 @@ [D-BUS Service] Interface=org.nemo.ssu Name=org.nemo.ssu -Exec=/usr/bin/ssud -User=root \ No newline at end of file +Exec=/bin/false +User=root +SystemdService=dbus-org.nemo.ssu.service + diff --git a/rpm/ssu.spec b/rpm/ssu.spec index f7e1e67..f7180f4 100644 --- a/rpm/ssu.spec +++ b/rpm/ssu.spec @@ -36,6 +36,7 @@ Requires: ssu-network-proxy # them for the vendor data packages to use %attr(0755, -, -) %{_oneshotdir}/* %{_bindir}/ssud +/lib/systemd/system/*.service %{_datadir}/dbus-1/system-services/*.service %{_sysconfdir}/dbus-1/system.d/*.conf diff --git a/ssud/ssud.pro b/ssud/ssud.pro index 74d7b5a..b33b9af 100644 --- a/ssud/ssud.pro +++ b/ssud/ssud.pro @@ -13,10 +13,13 @@ SOURCES = ssuadaptor.cpp \ DBUS_SERVICE_NAME=org.nemo.ssu +systemd.files = ../systemd/dbus-$${DBUS_SERVICE_NAME}.service +systemd.path = /lib/systemd/system/ + service.files = ../dbus/$${DBUS_SERVICE_NAME}.service service.path = /usr/share/dbus-1/system-services/ conf.files = ../dbus/$${DBUS_SERVICE_NAME}.conf conf.path = /etc/dbus-1/system.d/ -INSTALLS += service conf +INSTALLS += systemd service conf diff --git a/systemd/dbus-org.nemo.ssu.service b/systemd/dbus-org.nemo.ssu.service new file mode 100644 index 0000000..649a1d4 --- /dev/null +++ b/systemd/dbus-org.nemo.ssu.service @@ -0,0 +1,8 @@ +[Unit] +Description=SSU service + +[Service] +Type=dbus +BusName=org.nemo.ssu +ExecStart=/usr/bin/ssud +