summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-11-10 13:31:19 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-11-17 12:29:50 +0100
commit39bf07694c5716cce3cb7e25c6d01b441b6b4e01 (patch)
tree4afffd1c244936ba54bff308e6df1373dea896d4 /libpod/container_internal_linux.go
parent3502860e1cfe1042aca7a8de8446360662a5a2fd (diff)
downloadpodman-39bf07694c5716cce3cb7e25c6d01b441b6b4e01.tar.gz
podman-39bf07694c5716cce3cb7e25c6d01b441b6b4e01.tar.bz2
podman-39bf07694c5716cce3cb7e25c6d01b441b6b4e01.zip
use container cgroups path
When looking up a container's cgroup path, parse /proc/[PID]/cgroup. This will work across all cgroup managers and configurations and is supported on cgroups v1 and v2. Fixes: #8265 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 83d5c20cb..7754a65c5 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2091,10 +2091,7 @@ func (c *Container) getOCICgroupPath() (string, error) {
logrus.Debugf("Setting CGroups for container %s to %s", c.ID(), systemdCgroups)
return systemdCgroups, nil
case cgroupManager == config.CgroupfsCgroupsManager:
- cgroupPath, err := c.CGroupPath()
- if err != nil {
- return "", err
- }
+ cgroupPath := filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-%s", c.ID()))
logrus.Debugf("Setting CGroup path for container %s to %s", c.ID(), cgroupPath)
return cgroupPath, nil
default: