From: Lennart Poettering Date: Thu, 11 Jul 2013 16:37:14 +0000 (+0200) Subject: cgroup: don't move systemd into systems.slice when running as --user instance X-Git-Tag: v206~139 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=be2c1bd2a843aa61901086fccbae15b3aa085fb1 cgroup: don't move systemd into systems.slice when running as --user instance --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index b5d134785..b9ef00c61 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;