summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-10 23:31:40 +0200
committerLennart Poettering <lennart@poettering.net>2013-07-10 23:41:03 +0200
commit6797c324a653f119a3d7133122648aaa4878ddd6 (patch)
treeeca8fabe59addcf4762bf934df623c176bc23242 /src/login/logind.c
parent72673e866a83e6aafdbb599eb3eff2617b7dc79d (diff)
logind: don't misunderstand UnitRemoved signals during reloading
When PID 1 reloads the units logind/machined will see UnitRemoved signals for all units. Instead of trusting these immediately, let's check the actual unit state before considering a unit gone, so that reloading PID 1 is not mistaken as the end of all sessions.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index fcb3ccf4a5..a79ba333d2 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1038,12 +1038,23 @@ static int manager_connect_bus(Manager *m) {
"interface='org.freedesktop.DBus.Properties',"
"member='PropertiesChanged'",
&error);
-
if (dbus_error_is_set(&error)) {
log_error("Failed to add match for PropertiesChanged: %s", bus_error_message(&error));
dbus_error_free(&error);
}
+ dbus_bus_add_match(m->bus,
+ "type='signal',"
+ "sender='org.freedesktop.systemd1',"
+ "interface='org.freedesktop.systemd1.Manager',"
+ "member='Reloading',"
+ "path='/org/freedesktop/systemd1'",
+ &error);
+ if (dbus_error_is_set(&error)) {
+ log_error("Failed to add match for Reloading: %s", bus_error_message(&error));
+ dbus_error_free(&error);
+ }
+
r = bus_method_call_with_reply(
m->bus,
"org.freedesktop.systemd1",