summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-05-08 13:04:59 +0200
committerGitHub <noreply@github.com>2020-05-08 13:04:59 +0200
commitff1c59065e9d2ef0c03ce8de444b489630d00b3c (patch)
tree3923827125e9f097a384df5196831014fc68d9a1
parent241d78351e1efaf1cc4bb1e0f33741c1b585d7c4 (diff)
parent676efd89d5ff4eb8f473fbd994809cc263cf504a (diff)
downloadpodman-ff1c59065e9d2ef0c03ce8de444b489630d00b3c.tar.gz
podman-ff1c59065e9d2ef0c03ce8de444b489630d00b3c.tar.bz2
podman-ff1c59065e9d2ef0c03ce8de444b489630d00b3c.zip
Merge pull request #6130 from vrothberg/pidfile
set --conmon-pidfile
-rw-r--r--cmd/podman/common/specgen.go1
-rw-r--r--test/system/030-run.bats16
2 files changed, 17 insertions, 0 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 9a2345064..ff7c39de2 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -501,6 +501,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
s.CapDrop = c.CapDrop
s.Privileged = c.Privileged
s.ReadOnlyFilesystem = c.ReadOnly
+ s.ConmonPidFile = c.ConmonPIDFile
// TODO
// ouitside of specgen and oci though
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 56e9fed3b..d5d5121f8 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -158,4 +158,20 @@ echo $rand | 0 | $rand
run_podman 1 image exists $NONLOCAL_IMAGE
}
+# 'run --conmon-pidfile --cid-file' makes sure we don't regress on these flags.
+# Both are critical for systemd units.
+@test "podman run --conmon-pidfile --cidfile" {
+ pid=$(mktemp)
+ cid=$(mktemp)
+
+ # CID file exists -> expected to fail.
+ run_podman 125 run --rm --conmon-pidfile=$pid --cidfile=$cid $IMAGE ls
+
+ rm $pid $cid
+ run_podman run --name keepme --conmon-pidfile=$pid --cidfile=$cid --detach $IMAGE sleep infinity
+ stat $pid $cid
+ run_podman rm -f keepme
+ rm $pid $cid
+}
+
# vim: filetype=sh