mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user