mirror of
https://github.com/containers/podman.git
synced 2025-12-11 17:27:19 +08:00
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>
This commit is contained in:
@@ -109,6 +109,11 @@ WantedBy=multi-user.target
|
||||
stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
|
||||
stats.WaitWithDefaultTimeout()
|
||||
Expect(stats).Should(Exit(0))
|
||||
|
||||
cgroupPath := podmanTest.Podman([]string{"inspect", "--format='{{.State.CgroupPath}}'", ctrName})
|
||||
cgroupPath.WaitWithDefaultTimeout()
|
||||
Expect(cgroupPath).Should(Exit(0))
|
||||
Expect(result.OutputToString()).To(Not(ContainSubstring("init.scope")))
|
||||
})
|
||||
|
||||
It("podman create container with systemd entrypoint triggers systemd mode", func() {
|
||||
|
||||
Reference in New Issue
Block a user