mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 04:08:12 +02:00
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
This commit is contained in:
parent
c937a39e4b
commit
03c0db9ff5
4 changed files with 19 additions and 0 deletions
|
|
@ -320,6 +320,7 @@ handle_reload_watch (DBusWatch *watch,
|
|||
loop = bus_context_get_loop (context);
|
||||
if (loop != NULL)
|
||||
{
|
||||
_dbus_daemon_report_stopping ();
|
||||
_dbus_loop_quit (loop);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1669,3 +1669,8 @@ void
|
|||
_dbus_daemon_report_reloaded (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_dbus_daemon_report_stopping (void)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,6 +690,7 @@ void _dbus_rlimit_free (DBusRLimit *lim);
|
|||
void _dbus_daemon_report_ready (void);
|
||||
void _dbus_daemon_report_reloading (void);
|
||||
void _dbus_daemon_report_reloaded (void);
|
||||
void _dbus_daemon_report_stopping (void);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue