X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fscope.c;h=b94f3ff7ba2758c50d3946b9bd3c634bc39186ea;hb=112a7f4696ebb96abdb42df62e1e794e903f66b3;hp=e0de951b11cd613dcf0048b57c1fea2918204568;hpb=358712f3de33789b2d1293825f1add2c6f4b8e66;p=elogind.git diff --git a/src/core/scope.c b/src/core/scope.c index e0de951b1..b94f3ff7b 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;