summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-08-13 17:59:28 +0200
committerLennart Poettering <lennart@poettering.net>2013-08-13 17:59:28 +0200
commit405e0255d5e6950180d9563f1a26294b5360db03 (patch)
tree99bd33e34bee035602bfce76a8537d227414cf7f /src/login/logind.c
parentee530d8b73246f29781bd54a707ca75c7ef5a6cb (diff)
logind: restore logic to kill user processes when session ends
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index a79ba333d2..0002d262c1 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1244,6 +1244,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
if (session_check_gc(session, drop_not_started) == 0) {
session_stop(session);
+ session_finalize(session);
session_free(session);
}
}
@@ -1254,6 +1255,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
if (user_check_gc(user, drop_not_started) == 0) {
user_stop(user);
+ user_finalize(user);
user_free(user);
}
}
@@ -1298,6 +1300,22 @@ int manager_get_idle_hint(Manager *m, dual_timestamp *t) {
return idle_hint;
}
+bool manager_shall_kill(Manager *m, const char *user) {
+ assert(m);
+ assert(user);
+
+ if (!m->kill_user_processes)
+ return false;
+
+ if (strv_contains(m->kill_exclude_users, user))
+ return false;
+
+ if (strv_isempty(m->kill_only_users))
+ return true;
+
+ return strv_contains(m->kill_only_users, user);
+}
+
int manager_dispatch_idle_action(Manager *m) {
struct dual_timestamp since;
struct itimerspec its = {};