Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Add back check for mountpoint to return consistent error
Browse files Browse the repository at this point in the history
Adding this check here allows a nice error displaying that the specified
cgroup subsystem is not mounted.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
  • Loading branch information
crosbymichael committed Mar 23, 2015
1 parent fc3981e commit c5eef90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cgroups/fs/apply_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5eef90

Please sign in to comment.