35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
From dd457c767956157e697ac3b384399ff71ed0673d Mon Sep 17 00:00:00 2001
|
|
From: liuhao <liuhao27@huawei.com>
|
|
Date: Wed, 19 Jun 2019 16:48:50 +0800
|
|
Subject: [PATCH 116/139] 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/<controller>/system.slice/xxx/lxc
|
|
directory, this is not consistent with docker. The default cgroup path
|
|
should be under /sys/fs/cgroup/<controller>/lxc directory.
|
|
|
|
Signed-off-by: zhangsong <zhangsong34@huawei.com>
|
|
Signed-off-by: LiFeng <lifeng68@huawei.com>
|
|
---
|
|
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
|
|
|