Skip to content

Commit 56fc0ac

Browse files
author
Mrunal Patel
authored
Merge pull request #966 from sjenning/fix-initscope-cgroup-path
fix init.scope in cgroup paths
2 parents 1a81e9a + 4b44b98 commit 56fc0ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcontainer/cgroups/systemd/apply_systemd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ func getSubsystemPath(c *configs.Cgroup, subsystem string) (string, error) {
388388
if err != nil {
389389
return "", err
390390
}
391+
// if pid 1 is systemd 226 or later, it will be in init.scope, not the root
392+
initPath = strings.TrimSuffix(filepath.Clean(initPath), "init.scope")
391393

392394
slice := "system.slice"
393395
if c.Parent != "" {

0 commit comments

Comments
 (0)