Skip to content

Commit

Permalink
core: check for SERVICE_RELOAD_NOTIFY in manager_dbus_is_running
Browse files Browse the repository at this point in the history
This ensures that systemd won't erronously disconnect from the system
bus in case a bus recheck is triggered immediately after the bus service
emits `RELOADING=1`.

This fixes an issue where systemd-logind sometimes randomly stops
receiving `UnitRemoved` after a system update.

This also handles SERVICE_RELOAD_SIGNAL just in case somebody ever
creates a D-Bus broker implementation that uses `Type=notify-reload`.

(cherry picked from commit 845824a)

Related: RHEL-6090
  • Loading branch information
msizanoen1 authored and dtardon committed Aug 31, 2023
1 parent f211957 commit d879fea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,11 @@ static bool manager_dbus_is_running(Manager *m, bool deserialized) {
u = manager_get_unit(m, SPECIAL_DBUS_SERVICE);
if (!u)
return false;
if (!IN_SET((deserialized ? SERVICE(u)->deserialized_state : SERVICE(u)->state), SERVICE_RUNNING, SERVICE_RELOAD))
if (!IN_SET((deserialized ? SERVICE(u)->deserialized_state : SERVICE(u)->state),
SERVICE_RUNNING,
SERVICE_RELOAD,
SERVICE_RELOAD_NOTIFY,
SERVICE_RELOAD_SIGNAL))
return false;

return true;
Expand Down

0 comments on commit d879fea

Please sign in to comment.