summaryrefslogtreecommitdiff
path: root/libpod/oci_conmon_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-01-14 15:05:12 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-01-16 18:56:51 +0100
commitba0a6f34e349bfb5cf70cb2062522e6af1b9578c (patch)
treeb74d4b895ac5b39d4b1f6448aab2fd8c7ac7dbcc /libpod/oci_conmon_linux.go
parent30245affe9881fdedc869ccb68faa3e2f5fb9366 (diff)
downloadpodman-ba0a6f34e349bfb5cf70cb2062522e6af1b9578c.tar.gz
podman-ba0a6f34e349bfb5cf70cb2062522e6af1b9578c.tar.bz2
podman-ba0a6f34e349bfb5cf70cb2062522e6af1b9578c.zip
podman: add new option --cgroups=no-conmon
it allows to disable cgroups creation only for the conmon process. A new cgroup is created for the container payload. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r--libpod/oci_conmon_linux.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 5ab0e73c4..7c7ec8b2c 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -1297,11 +1297,17 @@ func startCommandGivenSelinux(cmd *exec.Cmd) error {
// it then signals for conmon to start by sending nonse data down the start fd
func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {
mustCreateCgroup := true
- // If cgroup creation is disabled - just signal.
+
if ctr.config.NoCgroups {
mustCreateCgroup = false
}
+ // If cgroup creation is disabled - just signal.
+ switch ctr.config.CgroupsMode {
+ case "disabled", "no-conmon":
+ mustCreateCgroup = false
+ }
+
if mustCreateCgroup {
cgroupParent := ctr.CgroupParent()
if r.cgroupManager == define.SystemdCgroupsManager {