summaryrefslogtreecommitdiff
path: root/src/login/logind-session.c
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-07-26 10:26:15 +0200
committerSven Eden <yamakuzure@gmx.net>2017-07-26 10:26:15 +0200
commitf3f6ae7c983865ea37e8ddfbd676586e55280f1e (patch)
tree7ae78f62d75d628aa00d800b8ded87fb2e1ab708 /src/login/logind-session.c
parent7e17c59e6b33219e1d478a74852a64d4c726d76b (diff)
Prep v234: Re-add user/session to the gc_queue when stopping.
If manager_gc() does not find the user/session, their respective finalize_*() method is never called, leaving stale state files in /run/systemd/sessions and run/systemd/users.
Diffstat (limited to 'src/login/logind-session.c')
-rw-r--r--src/login/logind-session.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 28784a867..10e9327c0 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -768,6 +768,10 @@ int session_stop(Session *s, bool force) {
session_save(s);
user_save(s->user);
+#if 1 /// elogind must queue this session again
+ session_add_to_gc_queue(s);
+#endif // 1
+
return r;
}
@@ -819,7 +823,6 @@ int session_finalize(Session *s) {
return 0;
}
-#if 0 /// UNNEEDED by elogind
static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *userdata) {
Session *s = userdata;
@@ -829,7 +832,6 @@ 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);
@@ -840,18 +842,11 @@ int session_release(Session *s) {
if (s->timer_event_source)
return 0;
-#if 0 /// UNNEEDED by elogind
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
- /* In systemd, session release is triggered by user jobs
- dying. In elogind we don't have that so go ahead and stop
- now. */
- return session_stop(s, false);
-#endif // 0
}
bool session_is_active(Session *s) {