summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-15 23:55:53 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-15 23:55:53 +0100
commit0baf24ddd51fe3399ede0ed5a92f02e54e5ea1ef (patch)
treeb7fe3b51aa0bff120efaf42380fe82adfe67d580 /src
parente3aa71c38cbecb24e6333411ee19814796a5b1d0 (diff)
cgroup: call root cgroup system instead of systemd-1
Diffstat (limited to 'src')
-rw-r--r--src/cgroup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cgroup.c b/src/cgroup.c
index 5130d3a89f..57c9c9e99e 100644
--- a/src/cgroup.c
+++ b/src/cgroup.c
@@ -230,8 +230,12 @@ int manager_setup_cgroup(Manager *m) {
if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 0, &current)) < 0)
goto finish;
- snprintf(suffix, sizeof(suffix), "/systemd-%lu", (unsigned long) getpid());
- char_array_0(suffix);
+ if (m->running_as == MANAGER_SYSTEM)
+ strcpy(suffix, "/system");
+ else {
+ snprintf(suffix, sizeof(suffix), "/systemd-%lu", (unsigned long) getpid());
+ char_array_0(suffix);
+ }
free(m->cgroup_hierarchy);
if (endswith(current, suffix)) {