From c5eef904604b7e22083927bb99ea0c196d4cb8b9 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 23 Mar 2015 12:20:18 -0700 Subject: [PATCH] Add back check for mountpoint to return consistent error Adding this check here allows a nice error displaying that the specified cgroup subsystem is not mounted. Signed-off-by: Michael Crosby --- cgroups/fs/apply_raw.go | 6 ++++++ 1 file changed, 6 insertions(+) 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