summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2015-09-01 12:30:17 +0200
committerAndy Wingo <wingo@pobox.com>2015-09-01 12:30:17 +0200
commit81d08ba2e8e3cc1e59ab057953f18119804b9ff9 (patch)
tree33d169dbe536886e7146b6e4ce7d6c6785e2bf8b
parentc8e9d44726ae4ad6ceafe5b7eda11e876541d6aa (diff)
Stop sessions on ReleaseSessionelogind/v219.11
-rw-r--r--configure.ac2
-rw-r--r--src/login/logind-dbus.c2
-rw-r--r--src/login/logind-session.c21
3 files changed, 7 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 5871ace529..0f004e3584 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 859ad3b58c..5e6952de05 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -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);
}
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 08ca8072ae..109e3ef133 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -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) {