Merge pull request #3564 from giuseppe/cgroupsv2-no-controllers-last-path
cgroupsv2: do not enable controllers for the last component
This commit is contained in:
commit
c59d08bc77
|
@ -187,8 +187,12 @@ func createCgroupv2Path(path string) (Err error) {
|
|||
}()
|
||||
}
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(current, "cgroup.subtree_control"), resByte, 0755); err != nil {
|
||||
return errors.Wrapf(err, "write %s", filepath.Join(current, "cgroup.subtree_control"))
|
||||
// We enable the controllers for all the path components except the last one. It is not allowed to add
|
||||
// PIDs if there are already enabled controllers.
|
||||
if i < len(elements[3:])-1 {
|
||||
if err := ioutil.WriteFile(filepath.Join(current, "cgroup.subtree_control"), resByte, 0755); err != nil {
|
||||
return errors.Wrapf(err, "write %s", filepath.Join(current, "cgroup.subtree_control"))
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue