]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind-user: check linger file in user_wants_service_manager too 33066/head
authorMike Yuan <me@yhndnzj.com>
Tue, 28 May 2024 16:43:06 +0000 (00:43 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 28 May 2024 16:50:07 +0000 (00:50 +0800)
Follow-up for 5099a50d4398e190387d204f5df81cc176bd33e2

Fixes #33005

src/login/logind-user.c

index e51ab1cd19e5031a59c9380ea98f88de16f065ea..c63d214146cba3da5e2e3938cfd04343146240cf 100644 (file)
@@ -371,13 +371,16 @@ static int user_start_runtime_dir(User *u) {
         return 0;
 }
 
-static bool user_wants_service_manager(User *u) {
+static bool user_wants_service_manager(const User *u) {
         assert(u);
 
         LIST_FOREACH(sessions_by_user, s, u->sessions)
                 if (SESSION_CLASS_WANTS_SERVICE_MANAGER(s->class))
                         return true;
 
+        if (user_check_linger_file(u) > 0)
+                return true;
+
         return false;
 }