summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-11 18:37:14 +0200
committerLennart Poettering <lennart@poettering.net>2013-07-11 18:49:52 +0200
commitbe2c1bd2a843aa61901086fccbae15b3aa085fb1 (patch)
treecb9fbcf4bb49cc7de12e407e70e61ee22425824b /src/core
parenta8833944647bfd10e43569646be954db5cbac54e (diff)
cgroup: don't move systemd into systems.slice when running as --user instance
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cgroup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index b5d1347856..b9ef00c617 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -638,8 +638,11 @@ int manager_setup_cgroup(Manager *m) {
}
/* 4. Realize the system slice and put us in there */
- a = strappenda(m->cgroup_root, "/" SPECIAL_SYSTEM_SLICE);
- r = cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, a, 0);
+ if (m->running_as == SYSTEMD_SYSTEM) {
+ a = strappenda(m->cgroup_root, "/" SPECIAL_SYSTEM_SLICE);
+ r = cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, a, 0);
+ } else
+ r = cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, 0);
if (r < 0) {
log_error("Failed to create root cgroup hierarchy: %s", strerror(-r));
return r;