summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 3b24f2c23..4dbf5526d 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -328,19 +328,15 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string) (er
logrus.Warnf("Failed to add conmon to systemd sandbox cgroup: %v", err)
}
} else {
- cgroupPath, err := ctr.CGroupPath()
+ cgroupPath := filepath.Join(ctr.config.CgroupParent, fmt.Sprintf("libpod-%s", ctr.ID()), "conmon")
+ control, err := cgroups.New(cgroups.V1, cgroups.StaticPath(cgroupPath), &spec.LinuxResources{})
if err != nil {
- logrus.Errorf("Failed to generate CGroup path for conmon: %v", err)
+ logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
} else {
- control, err := cgroups.New(cgroups.V1, cgroups.StaticPath(cgroupPath), &spec.LinuxResources{})
- if err != nil {
+ // we need to remove this defer and delete the cgroup once conmon exits
+ // maybe need a conmon monitor?
+ if err := control.Add(cgroups.Process{Pid: cmd.Process.Pid}); err != nil {
logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
- } else {
- // we need to remove this defer and delete the cgroup once conmon exits
- // maybe need a conmon monitor?
- if err := control.Add(cgroups.Process{Pid: cmd.Process.Pid}); err != nil {
- logrus.Warnf("Failed to add conmon to cgroupfs sandbox cgroup: %v", err)
- }
}
}
}