diff --git a/cgroups/fs/apply_raw.go b/cgroups/fs/apply_raw.go index 2fc95421b..5cb8467c7 100644 --- a/cgroups/fs/apply_raw.go +++ b/cgroups/fs/apply_raw.go @@ -235,6 +235,12 @@ func (raw *data) parent(subsystem string) (string, error) { } func (raw *data) path(subsystem string) (string, error) { + _, err := cgroups.FindCgroupMountpoint(subsystem) + // If we didn't mount the subsystem, there is no point we make the path. + if err != nil { + return "", err + } + // If the cgroup name/path is absolute do not look relative to the cgroup of the init process. if filepath.IsAbs(raw.cgroup) { return filepath.Join(raw.root, subsystem, raw.cgroup), nil