From 09e9d64eda0979b581e6941f7152643909a9a95c Mon Sep 17 00:00:00 2001 From: liuhao Date: Wed, 19 Jun 2019 16:48:50 +0800 Subject: [PATCH 116/138] lxc: set base cgroup path to '/' reason:base cgroup may be started with /system.slice when cg_hybrid_init read /proc/1/cgroup on host, and cgroup init will set all containers cgroup path under /sys/fs/cgroup//system.slice/xxx/lxc directory, this is not consistent with docker. The default cgroup path should be under /sys/fs/cgroup//lxc directory. Signed-off-by: zhangsong Signed-off-by: LiFeng --- src/lxc/cgroups/cgfsng.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 46f13f4..7c92abe 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2545,6 +2545,9 @@ static bool cg_hybrid_init(struct cgroup_ops *ops) if (!writeable) goto next; */ + if (strlen(base_cgroup) > 1 && base_cgroup[0] == '/') { + base_cgroup[1] = '\0'; + } if (type == CGROUP2_SUPER_MAGIC) { char *cgv2_ctrl_path; -- 1.8.3.1