From 4b44b98596dba2e4c529ddfbd702de1e4e8149ec Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Tue, 26 Jul 2016 20:57:38 -0500 Subject: [PATCH] fix init.scope in cgroup paths Signed-off-by: Seth Jennings --- libcontainer/cgroups/systemd/apply_systemd.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcontainer/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go index e60975b0..8b8b7c5c 100644 --- a/libcontainer/cgroups/systemd/apply_systemd.go +++ b/libcontainer/cgroups/systemd/apply_systemd.go @@ -388,6 +388,8 @@ func getSubsystemPath(c *configs.Cgroup, subsystem string) (string, error) { if err != nil { return "", err } + // if pid 1 is systemd 226 or later, it will be in init.scope, not the root + initPath = strings.TrimSuffix(filepath.Clean(initPath), "init.scope") slice := "system.slice" if c.Parent != "" {