mirror of
https://github.com/containers/podman.git
synced 2025-09-28 09:15:26 +08:00
Merge pull request #6200 from haircommander/skip-unified
cgroup: skip unified if we are using v1
This commit is contained in:
@ -517,6 +517,10 @@ func (c *CgroupControl) AddPid(pid int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, n := range names {
|
for _, n := range names {
|
||||||
|
// If we aren't using cgroup2, we won't write correctly to unified hierarchy
|
||||||
|
if !c.cgroup2 && n == "unified" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
p := filepath.Join(c.getCgroupv1Path(n), "tasks")
|
p := filepath.Join(c.getCgroupv1Path(n), "tasks")
|
||||||
if err := ioutil.WriteFile(p, pidString, 0644); err != nil {
|
if err := ioutil.WriteFile(p, pidString, 0644); err != nil {
|
||||||
return errors.Wrapf(err, "write %s", p)
|
return errors.Wrapf(err, "write %s", p)
|
||||||
|
Reference in New Issue
Block a user