chiark / gitweb /
Stop sessions on ReleaseSession v219.11
authorAndy Wingo <wingo@pobox.com>
Tue, 1 Sep 2015 10:30:17 +0000 (12:30 +0200)
committerAndy Wingo <wingo@pobox.com>
Tue, 1 Sep 2015 10:30:17 +0000 (12:30 +0200)
configure.ac
src/login/logind-dbus.c
src/login/logind-session.c

index 5871ace..0f004e3 100644 (file)
@@ -21,7 +21,7 @@ AC_PREREQ([2.64])
 
 # FIXME: Update to proper web page
 AC_INIT([elogind],
-        [219.10],
+        [219.11],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=elogind],
         [elogind],
         [http://www.freedesktop.org/wiki/Software/elogind])
index 859ad3b..5e6952d 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);
 }
 
index 08ca807..109e3ef 100644 (file)
@@ -38,8 +38,6 @@
 #include "bus-error.h"
 #include "logind-session.h"
 
-#define RELEASE_USEC (20*USEC_PER_SEC)
-
 static void session_remove_fifo(Session *s);
 
 Session* session_new(Manager *m, const char *id) {
@@ -599,16 +597,6 @@ int session_finalize(Session *s) {
         return r;
 }
 
-static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *userdata) {
-        Session *s = userdata;
-
-        assert(es);
-        assert(s);
-
-        session_stop(s, false);
-        return 0;
-}
-
 int session_release(Session *s) {
         assert(s);
 
@@ -618,11 +606,10 @@ int session_release(Session *s) {
         if (s->timer_event_source)
                 return 0;
 
-        return sd_event_add_time(s->manager->event,
-                                 &s->timer_event_source,
-                                 CLOCK_MONOTONIC,
-                                 now(CLOCK_MONOTONIC) + RELEASE_USEC, 0,
-                                 release_timeout_callback, s);
+        /* In systemd, session release is triggered by user jobs
+           dying.  In elogind we don't have that so go ahead and stop
+           now.  */
+        session_stop(s, false);
 }
 
 bool session_is_active(Session *s) {