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
committerMatthew Heon <mheon@redhat.com>2021-12-06 15:26:18 -0500
commit905eabf0bef95d5202483464779680f01a3cc1a1 (patch)
treeb8c34e4c6f15e06132ec589b8abb0d58e75efd24 /libpod/container_internal_linux.go
parente3a50e760998cdcda6be6510cfa6f1ca93ba7633 (diff)
downloadpodman-905eabf0bef95d5202483464779680f01a3cc1a1.tar.gz
podman-905eabf0bef95d5202483464779680f01a3cc1a1.tar.bz2
podman-905eabf0bef95d5202483464779680f01a3cc1a1.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> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@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 1c85339c7..8bd433427 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2512,7 +2512,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: