summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-util-unix.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-01-15 15:31:55 +0000
committerSimon McVittie <smcv@collabora.com>2018-03-02 14:49:15 +0000
commit03c0db9ff51dedeb98f42c715a70a1bd10c7f595 (patch)
tree67527301c9e96178e9612020ed5e5607a13010f0 /dbus/dbus-sysdeps-util-unix.c
parentc937a39e4ba1e297518edbd78feeb6f1cc764bd1 (diff)
downloaddbus-03c0db9ff51dedeb98f42c715a70a1bd10c7f595.tar.gz
bus: Also tell systemd before we shut down
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104641
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r--dbus/dbus-sysdeps-util-unix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 8a7c9278..24eba4e3 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -1556,3 +1556,15 @@ _dbus_daemon_report_reloaded (void)
_dbus_daemon_report_ready ();
#endif
}
+
+/**
+ * Report to a service manager that the daemon calling this function is
+ * shutting down. This is currently only implemented for systemd.
+ */
+void
+_dbus_daemon_report_stopping (void)
+{
+#ifdef HAVE_SYSTEMD
+ sd_notify (0, "STOPPING=1");
+#endif
+}