]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus: Also tell systemd when we're reloading
authorSimon McVittie <smcv@collabora.com>
Mon, 15 Jan 2018 15:31:41 +0000 (15:31 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 2 Mar 2018 14:49:11 +0000 (14:49 +0000)
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

bus/bus.c
dbus/dbus-sysdeps-util-unix.c
dbus/dbus-sysdeps-util-win.c
dbus/dbus-sysdeps.h

index abb2ea2f8752ee8c3fbafd68417aaff7d74192fc..9fd9820be8bab19425eb929b3831f05067f49211 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -1065,6 +1065,8 @@ bus_context_reload_config (BusContext *context,
   DBusString config_file;
   dbus_bool_t ret;
 
+  _dbus_daemon_report_reloading ();
+
   /* Flush the user database cache */
   _dbus_flush_caches ();
 
@@ -1095,6 +1097,8 @@ bus_context_reload_config (BusContext *context,
     bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Unable to reload configuration: %s", error->message);
   if (parser != NULL)
     bus_config_parser_unref (parser);
+
+  _dbus_daemon_report_reloaded ();
   return ret;
 }
 
index 838cd932e4edba7f22721d860cf1c3be7f45cfef..8a7c92782982411a5fdb37422fa2ae8475496cd8 100644 (file)
@@ -1531,3 +1531,28 @@ _dbus_daemon_report_ready (void)
   sd_notify (0, "READY=1");
 #endif
 }
+
+/**
+ * Report to a service manager that the daemon calling this function is
+ * reloading configuration. This is currently only implemented for systemd.
+ */
+void
+_dbus_daemon_report_reloading (void)
+{
+#ifdef HAVE_SYSTEMD
+  sd_notify (0, "RELOADING=1");
+#endif
+}
+
+/**
+ * Report to a service manager that the daemon calling this function is
+ * reloading configuration. This is currently only implemented for systemd.
+ */
+void
+_dbus_daemon_report_reloaded (void)
+{
+#ifdef HAVE_SYSTEMD
+  /* For systemd, this is the same code */
+  _dbus_daemon_report_ready ();
+#endif
+}
index f613130e3a0310307229f8e6638de9cb17cd038c..917dd05e9e4bbc933615b5a7ed8200ae6ce02b79 100644 (file)
@@ -1659,3 +1659,13 @@ void
 _dbus_daemon_report_ready (void)
 {
 }
+
+void
+_dbus_daemon_report_reloading (void)
+{
+}
+
+void
+_dbus_daemon_report_reloaded (void)
+{
+}
index b2943906bc36e7c625103c871f6113fa78740723..d8e695898395ee79ccc9339576ea4a5cdad83832 100644 (file)
@@ -688,6 +688,8 @@ dbus_bool_t     _dbus_rlimit_restore_fd_limit              (DBusRLimit   *saved,
 void            _dbus_rlimit_free                          (DBusRLimit   *lim);
 
 void            _dbus_daemon_report_ready                  (void);
+void            _dbus_daemon_report_reloading              (void);
+void            _dbus_daemon_report_reloaded               (void);
 
 /** @} */