summaryrefslogtreecommitdiff
path: root/src/core/scope.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-28 12:20:29 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-28 12:20:57 +0200
commitdd305ec9c6c2ef6e0b5e43de388a98825385b359 (patch)
tree4cf8e0bcfa7fdd29e17eda6aefdc6c97cc5a606b /src/core/scope.c
parent373a99e489ac0622ac2ed7f37e9670561c5835a8 (diff)
core: when we cannot add PID to a scope cgroup, log about it
Also, place the scope unit in failed state.
Diffstat (limited to 'src/core/scope.c')
-rw-r--r--src/core/scope.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/scope.c b/src/core/scope.c
index 1c3c6bb540..1848641d81 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -277,6 +277,7 @@ static int scope_start(Unit *u) {
if (s->state == SCOPE_FAILED)
return -EPERM;
+ /* We can't fulfill this right now, please try again later */
if (s->state == SCOPE_STOP_SIGTERM ||
s->state == SCOPE_STOP_SIGKILL)
return -EAGAIN;
@@ -290,8 +291,11 @@ static int scope_start(Unit *u) {
(void) unit_reset_cpu_usage(u);
r = unit_attach_pids_to_cgroup(u);
- if (r < 0)
+ if (r < 0) {
+ log_unit_warning_errno(UNIT(s)->id, r, "%s: Failed to add PIDs to scope's control group: %m", UNIT(s)->id);
+ scope_enter_dead(s, SERVICE_FAILURE_RESOURCES);
return r;
+ }
s->result = SCOPE_SUCCESS;