summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-14 19:11:07 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-17 15:49:21 +0100
commitbc432dc7eb62c5671f2b741a86a66393adb350dc (patch)
treeb7fb6ea81706fa02363c842cd233387d6b777bf9 /src/core/unit.c
parentb1e90ec515408aec2702522f6f68c4920b56375b (diff)
core: rework cgroup mask propagation
Previously a cgroup setting down tree would result in cgroup membership additions being propagated up the tree and to the siblings, however a unit could never lose cgroup memberships again. With this change we'll make sure that both cgroup additions and removals propagate properly.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 0277675f60..b91fcf1957 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -778,7 +778,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
prefix, strna(unit_slice_name(u)),
prefix, strna(u->cgroup_path),
prefix, yes_no(u->cgroup_realized),
- prefix, u->cgroup_mask,
+ prefix, u->cgroup_realized_mask,
prefix, u->cgroup_members_mask);
SET_FOREACH(t, u->names, i)
@@ -1056,21 +1056,17 @@ int unit_load(Unit *u) {
goto fail;
}
- unit_update_member_masks(u);
-
r = unit_add_mount_links(u);
if (r < 0)
goto fail;
- if (u->on_failure_job_mode == JOB_ISOLATE &&
- set_size(u->dependencies[UNIT_ON_FAILURE]) > 1) {
-
- log_error_unit(u->id,
- "More than one OnFailure= dependencies specified for %s but OnFailureJobMode=isolate set. Refusing.", u->id);
-
+ if (u->on_failure_job_mode == JOB_ISOLATE && set_size(u->dependencies[UNIT_ON_FAILURE]) > 1) {
+ log_error_unit(u->id, "More than one OnFailure= dependencies specified for %s but OnFailureJobMode=isolate set. Refusing.", u->id);
r = -EINVAL;
goto fail;
}
+
+ unit_update_cgroup_members_masks(u);
}
assert((u->load_state != UNIT_MERGED) == !u->merged_into);