chiark / gitweb /
Stop sessions on ReleaseSession
[elogind.git] / src / login / logind-session.c
index 1a3567194c7593f51b26772e767a595f1faf06da..b5e4bee9ee947c77dff27b93a97605805d410da1 100644 (file)
@@ -40,7 +40,7 @@
 #include "formats-util.h"
 #include "terminal-util.h"
 
-#define RELEASE_USEC (20*USEC_PER_SEC)
+// #define RELEASE_USEC (20*USEC_PER_SEC)
 
 static void session_remove_fifo(Session *s);
 
@@ -726,6 +726,8 @@ int session_finalize(Session *s) {
         return 0;
 }
 
+/// UNNEEDED by elogind
+#if 0
 static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *userdata) {
         Session *s = userdata;
 
@@ -735,6 +737,7 @@ static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *us
         session_stop(s, false);
         return 0;
 }
+#endif // 0
 
 int session_release(Session *s) {
         assert(s);
@@ -745,11 +748,19 @@ int session_release(Session *s) {
         if (s->timer_event_source)
                 return 0;
 
+        /* In systemd, session release is triggered by user jobs
+           dying.  In elogind we don't have that so go ahead and stop
+           now.  */
+#if 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);
+
+#else
+        return session_stop(s, false);
+#endif // 0
 }
 
 bool session_is_active(Session *s) {