mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 13:28:02 +02:00
bus: Also tell systemd when we're reloading
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
This commit is contained in:
parent
18a0a8892b
commit
c937a39e4b
4 changed files with 41 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1659,3 +1659,13 @@ void
|
|||
_dbus_daemon_report_ready (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_dbus_daemon_report_reloading (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_dbus_daemon_report_reloaded (void)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue