Update cgroups to v1.0.2

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2021-10-08 08:44:12 -07:00
parent a4663097ec
commit 18d483b236
22 changed files with 199 additions and 239 deletions

View File

@@ -41,12 +41,7 @@ func apply(ctx context.Context, config *srvconfig.Config) error {
if cgroups.Mode() == cgroups.Unified {
cg, err := cgroupsv2.LoadManager("/sys/fs/cgroup", config.Cgroup.Path)
if err != nil {
if err != cgroupsv2.ErrCgroupDeleted {
return err
}
if cg, err = cgroupsv2.NewManager("/sys/fs/cgroup", config.Cgroup.Path, nil); err != nil {
return err
}
return err
}
if err := cg.AddProc(uint64(os.Getpid())); err != nil {
return err