|
@@ -235,16 +235,20 @@ func getCgroupData(c *configs.Cgroup, pid int) (*data, error) {
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
-func (raw *data) parent(subsystem, mountpoint string) (string, error) {
|
|
|
+func (raw *data) parent(subsystem, mountpoint, src string) (string, error) {
|
|
|
initPath, err := cgroups.GetInitCgroupDir(subsystem)
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
}
|
|
|
- return filepath.Join(mountpoint, initPath), nil
|
|
|
+ relDir, err := filepath.Rel(src, initPath)
|
|
|
+ if err != nil {
|
|
|
+ return "", err
|
|
|
+ }
|
|
|
+ return filepath.Join(mountpoint, relDir), nil
|
|
|
}
|
|
|
|
|
|
func (raw *data) path(subsystem string) (string, error) {
|
|
|
- mnt, err := cgroups.FindCgroupMountpoint(subsystem)
|
|
|
+ mnt, src, err := cgroups.FindCgroupMountpointAndSource(subsystem)
|
|
|
// If we didn't mount the subsystem, there is no point we make the path.
|
|
|
if err != nil {
|
|
|
return "", err
|
|
@@ -255,7 +259,7 @@ func (raw *data) path(subsystem string) (string, error) {
|
|
|
return filepath.Join(raw.root, subsystem, raw.cgroup), nil
|
|
|
}
|
|
|
|
|
|
- parent, err := raw.parent(subsystem, mnt)
|
|
|
+ parent, err := raw.parent(subsystem, mnt, src)
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
}
|