From be2c1bd2a843aa61901086fccbae15b3aa085fb1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 11 Jul 2013 18:37:14 +0200 Subject: cgroup: don't move systemd into systems.slice when running as --user instance --- src/core/cgroup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/cgroup.c') 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; -- cgit v1.2.3-54-g00ecf