X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fscope.c;h=50e5dbacb4d7fa3936b27d7732cb5341b3b42948;hb=7759ecb21e2057eacf2dbd111d2f13ea10bff844;hp=e0de951b11cd613dcf0048b57c1fea2918204568;hpb=358712f3de33789b2d1293825f1add2c6f4b8e66;p=elogind.git diff --git a/src/core/scope.c b/src/core/scope.c index e0de951b1..50e5dbacb 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -112,7 +112,7 @@ static int scope_verify(Scope *s) { if (UNIT(s)->load_state != UNIT_LOADED) return 0; - if (set_size(s->pids) <= 0) { + if (set_size(s->pids) <= 0 && UNIT(s)->manager->n_reloading <= 0) { log_error_unit(UNIT(s)->id, "Scope %s has no PIDs. Refusing.", UNIT(s)->id); return -EINVAL; } @@ -239,6 +239,9 @@ static int scope_start(Unit *u) { assert(s); + if (s->state == SCOPE_FAILED) + return -EPERM; + if (s->state == SCOPE_STOP_SIGTERM || s->state == SCOPE_STOP_SIGKILL) return -EAGAIN; @@ -254,7 +257,7 @@ static int scope_start(Unit *u) { return r; } - r = cg_attach_many_with_mask(u->cgroup_mask, u->cgroup_path, s->pids); + r = cg_attach_many_everywhere(u->manager->cgroup_supported, u->cgroup_path, s->pids); if (r < 0) return r;