summaryrefslogtreecommitdiff
path: root/src/login/logind-session.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-06 18:32:14 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-07 15:14:36 +0100
commit5f41d1f10fd97e93517b6a762b1bec247f4d1171 (patch)
treea599559b6177bd9fccd01c56f74fad9b81a61851 /src/login/logind-session.h
parenta911bb9ab27ac0eb3bbf4e8b4109e5da9b88eee3 (diff)
logind: rework session shutdown logic
Simplify the shutdown logic a bit: - Keep the session FIFO around in the PAM module, even after the session shutdown hook has been finished. This allows logind to track precisely when the PAM handler goes away. - In the ReleaseSession() call start a timer, that will stop terminate the session when elapsed. - Never fiddle with the KillMode of scopes to configure whether user processes should be killed or not. Instead, simply leave the scope units around when we terminate a session whose processes should not be killed. - When killing is enabled, stop the session scope on FIFO EOF or after the ReleaseSession() timeout. When killing is disabled, simply tell PID 1 to abandon the scope. Because the scopes stay around and hence all processes are always member of a scope, the system shutdown logic should be more robust, as the scopes can be shutdown as part of the usual shutdown logic.
Diffstat (limited to 'src/login/logind-session.h')
-rw-r--r--src/login/logind-session.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index 7bf193203..42552bc2b 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -110,9 +110,12 @@ struct Session {
bool in_gc_queue:1;
bool started:1;
+ bool stopping:1;
sd_bus_message *create_message;
+ sd_event_source *timer_event_source;
+
char *controller;
Hashmap *devices;
@@ -132,10 +135,10 @@ bool session_is_active(Session *s);
int session_get_idle_hint(Session *s, dual_timestamp *t);
void session_set_idle_hint(Session *s, bool b);
int session_create_fifo(Session *s);
-void session_remove_fifo(Session *s);
int session_start(Session *s);
int session_stop(Session *s);
int session_finalize(Session *s);
+void session_release(Session *s);
int session_save(Session *s);
int session_load(Session *s);
int session_kill(Session *s, KillWho who, int signo);