mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
oci_conmon: do not create a cgroup under systemd
Detect whether we are running under systemd (if the INVOCATION_ID is set). If Podman is running under a systemd service, we do not need to create a cgroup for conmon. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -1308,6 +1308,11 @@ func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec
|
||||
mustCreateCgroup = false
|
||||
}
|
||||
|
||||
// $INVOCATION_ID is set by systemd when running as a service.
|
||||
if os.Getenv("INVOCATION_ID") != "" {
|
||||
mustCreateCgroup = false
|
||||
}
|
||||
|
||||
if mustCreateCgroup {
|
||||
cgroupParent := ctr.CgroupParent()
|
||||
if r.cgroupManager == define.SystemdCgroupsManager {
|
||||
|
Reference in New Issue
Block a user