summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-11-24 10:35:07 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-11-24 14:50:12 +0100
commite648122b2986ea3bdcee33ebaef8731e574e8f54 (patch)
tree7d7b8b2bd8913a2810a3b6821e8fc4975a931054 /libpod/container_internal_linux.go
parenta66f40b4df039e94572fa38c070207a435cfa466 (diff)
downloadpodman-e648122b2986ea3bdcee33ebaef8731e574e8f54.tar.gz
podman-e648122b2986ea3bdcee33ebaef8731e574e8f54.tar.bz2
podman-e648122b2986ea3bdcee33ebaef8731e574e8f54.zip
libpod: improve heuristic to detect cgroup
improve the heuristic to detect the scope that was created for the container. This is necessary with systemd running as PID 1, since it moves itself to a different sub-cgroup, thus stats would not account for other processes in the same container. Closes: https://github.com/containers/podman/issues/12400 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 364b77f29..956460c32 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2618,7 +2618,7 @@ func (c *Container) getOCICgroupPath() (string, error) {
if err != nil {
return "", err
}
- return filepath.Join(selfCgroup, "container"), nil
+ return filepath.Join(selfCgroup, fmt.Sprintf("libpod-payload-%s", c.ID())), nil
case cgroupManager == config.SystemdCgroupsManager:
// When the OCI runtime is set to use Systemd as a cgroup manager, it
// expects cgroups to be passed as follows: