summaryrefslogtreecommitdiff
path: root/src/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-24 20:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-24 20:41:56 +0200
commit1713813de365486617ab87899f950e9b6ec928ef (patch)
treef2c7c33d8b039935dbaea697f2432bdff601d370 /src/logind-dbus.c
parentdec15e9263cadae02f4f51463860248af40475d0 (diff)
logind: remove a session when its cgroup is gone
Diffstat (limited to 'src/logind-dbus.c')
-rw-r--r--src/logind-dbus.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/logind-dbus.c b/src/logind-dbus.c
index 2a85749478..0f3de41fff 100644
--- a/src/logind-dbus.c
+++ b/src/logind-dbus.c
@@ -896,6 +896,36 @@ const DBusObjectPathVTable bus_manager_vtable = {
.message_function = manager_message_handler
};
+DBusHandlerResult bus_message_filter(
+ DBusConnection *connection,
+ DBusMessage *message,
+ void *userdata) {
+
+ Manager *m = userdata;
+ DBusError error;
+
+ assert(m);
+ assert(connection);
+ assert(message);
+
+ dbus_error_init(&error);
+
+ if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Agent", "Released")) {
+ const char *cgroup;
+
+ if (!dbus_message_get_args(message, &error,
+ DBUS_TYPE_STRING, &cgroup,
+ DBUS_TYPE_INVALID))
+ log_error("Failed to parse Released message: %s", bus_error_message(&error));
+ else
+ manager_cgroup_notify_empty(m, cgroup);
+ }
+
+ dbus_error_free(&error);
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
int manager_send_changed(Manager *manager, const char *properties) {
DBusMessage *m;
int r = -ENOMEM;