From 2d4e258564de52cdffdeae0b4db0c4c7c26b46f9 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 1 Jul 2026 17:01:27 +0100 Subject: [PATCH] core/scope: don't assert when start is retried during cgroup chown While a delegated scope waits for the async cgroup chown helper it sits in SCOPE_START_CHOWN (UNIT_ACTIVATING). unit_start() forwards to ->start() while activating, so scope_start() could be re-entered in that state and trip assert(s->state == SCOPE_DEAD), aborting PID 1. Treat SCOPE_START_CHOWN as already-starting instead. Follow-up for 03860190fefce8bbea3a6f0e77919b882ade517c (cherry picked from commit 62c182f0d5c2ec6cbdfaf808d143a8a4c7e01f29) (cherry picked from commit ce595a30c1340f90ee4a8c37b0e01b496a74c487) --- src/core/scope.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/scope.c b/src/core/scope.c index d36b27c537d..8aaa48404bc 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -441,6 +441,10 @@ static int scope_start(Unit *u) { if (IN_SET(s->state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL)) return -EAGAIN; + /* Already starting up (waiting for the async cgroup chown helper)? Then there's nothing to do. */ + if (s->state == SCOPE_START_CHOWN) + return 0; + assert(s->state == SCOPE_DEAD); if (!u->transient && !MANAGER_IS_RELOADING(u->manager))