From: Lennart Poettering Date: Mon, 15 Nov 2010 22:55:53 +0000 (+0100) Subject: cgroup: call root cgroup system instead of systemd-1 X-Git-Tag: v12~14 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0baf24ddd51fe3399ede0ed5a92f02e54e5ea1ef;p=systemd cgroup: call root cgroup system instead of systemd-1 --- diff --git a/src/cgroup.c b/src/cgroup.c index 5130d3a8..57c9c9e9 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, ¤t)) < 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)) {