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 03860190fe
This commit is contained in:
Luca Boccassi
2026-07-01 22:46:45 +01:00
parent b64a44707d
commit 62c182f0d5
+4
View File
@@ -437,6 +437,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))