chiark / gitweb /
Prep v238: Do not kill user processes if not forced and the user is lingering.
authorSven Eden <yamakuzure@gmx.net>
Mon, 18 Jun 2018 06:43:58 +0000 (08:43 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 29 Jun 2018 05:12:51 +0000 (07:12 +0200)
src/login/logind-session.c
src/login/logind-user.c

index f1e6d1dd70da7bd42bb39d1fdd6d31ef2281afbf..6d2b755ebfdb561e63e268ef72163dc9b744158f 100644 (file)
@@ -732,7 +732,14 @@ static int session_stop_cgroup(Session *s, bool force) {
 
         assert(s);
 
+#if 0 /// elogind must not kill lingering user processes alive
         if (force || manager_shall_kill(s->manager, s->user->name)) {
+#else
+        if (force
+          || ( manager_shall_kill(s->manager, s->user->name)
+            && (user_check_linger_file(s->user) < 1) ) ) {
+#endif // 1
+
                 r = session_kill(s, KILL_ALL, SIGTERM);
                 if (r < 0)
                         return r;
index 7bf92b2c28f2d5d4e96bafe88723024cddcd733b..86bb494061d27e6f57858ed1815ee484bdd46960 100644 (file)
@@ -722,8 +722,8 @@ bool user_may_gc(User *u, bool drop_not_started) {
                 return false;
 
         if (u->service_job && manager_job_is_active(u->manager, u->service_job))
-#endif // 0
                 return false;
+#endif // 0
 
         return true;
 }