chiark / gitweb /
Stop sessions on ReleaseSession
[elogind.git] / src / login / logind-dbus.c
index b735366fe161086601300488b6e3f5ed63db6c0a..5e6952de0593add01e1c4296654878c0e42f7b5c 100644 (file)
@@ -837,6 +837,8 @@ static int method_release_session(sd_bus *bus, sd_bus_message *message, void *us
         if (r < 0)
                 return r;
 
+        session_add_to_gc_queue(session);
+
         return sd_bus_reply_method_return(message, NULL);
 }
 
@@ -1422,10 +1424,6 @@ static int execute_shutdown_or_sleep(
                 InhibitWhat w,
                 HandleAction action,
                 sd_bus_error *error) {
-
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        const char *p;
-        char *c;
         int r;
 
         assert(m);
@@ -1434,28 +1432,10 @@ static int execute_shutdown_or_sleep(
 
         bus_manager_log_shutdown(m, w, action);
 
-        /* FIXME: here do the thing.  */
-
-        r = sd_bus_call_method(
-                        m->bus,
-                        "org.freedesktop.systemd1",
-                        "/org/freedesktop/systemd1",
-                        "org.freedesktop.systemd1.Manager",
-                        "StartUnit",
-                        error,
-                        &reply,
-                        "ss", NULL, "replace-irreversibly");
+        r = shutdown_or_sleep(m, action);
         if (r < 0)
                 return r;
 
-        r = sd_bus_message_read(reply, "o", &p);
-        if (r < 0)
-                return r;
-
-        c = strdup(p);
-        if (!c)
-                return -ENOMEM;
-
         /* Make sure the lid switch is ignored for a while (?) */
         manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + m->holdoff_timeout_usec);