Move the process outside of the systemd cgroup
If you don't move the process out of the named cgroup for systemd then systemd will try to delete all the cgroups that the process is currently in. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
3d8a20bb77
commit
27dd48f691
|
@ -29,6 +29,7 @@ var (
|
||||||
&NetPrioGroup{},
|
&NetPrioGroup{},
|
||||||
&PerfEventGroup{},
|
&PerfEventGroup{},
|
||||||
&FreezerGroup{},
|
&FreezerGroup{},
|
||||||
|
&NameGroup{GroupName: "name=systemd", Join: true},
|
||||||
}
|
}
|
||||||
CgroupProcesses = "cgroup.procs"
|
CgroupProcesses = "cgroup.procs"
|
||||||
HugePageSizes, _ = cgroups.GetHugePageSize()
|
HugePageSizes, _ = cgroups.GetHugePageSize()
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
type NameGroup struct {
|
type NameGroup struct {
|
||||||
GroupName string
|
GroupName string
|
||||||
|
Join bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *NameGroup) Name() string {
|
func (s *NameGroup) Name() string {
|
||||||
|
@ -16,6 +17,10 @@ func (s *NameGroup) Name() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *NameGroup) Apply(d *cgroupData) error {
|
func (s *NameGroup) Apply(d *cgroupData) error {
|
||||||
|
if s.Join {
|
||||||
|
// ignore errors if the named cgroup does not exist
|
||||||
|
d.join(s.GroupName)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +29,9 @@ func (s *NameGroup) Set(path string, cgroup *configs.Cgroup) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *NameGroup) Remove(d *cgroupData) error {
|
func (s *NameGroup) Remove(d *cgroupData) error {
|
||||||
|
if s.Join {
|
||||||
|
removePath(d.path(s.GroupName))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue