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 <crosbymichael@gmail.com>
This commit is contained in:
parent
fc3981ea5c
commit
c5eef90460
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue