summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-16 18:31:08 +0100
committerGitHub <noreply@github.com>2020-01-16 18:31:08 +0100
commit30245affe9881fdedc869ccb68faa3e2f5fb9366 (patch)
tree488914a59afb4842c18df11547a1f5f493ff368a
parent1d7176b135fab2da4800b11f91b912963aa0288b (diff)
parent9d3667c2f025e1e36f3fdbd7348e0e14d00e336d (diff)
downloadpodman-30245affe9881fdedc869ccb68faa3e2f5fb9366.tar.gz
podman-30245affe9881fdedc869ccb68faa3e2f5fb9366.tar.bz2
podman-30245affe9881fdedc869ccb68faa3e2f5fb9366.zip
Merge pull request #4884 from vrothberg/systemd-ignore
systemdgen: add --ignore flag to generic services
-rw-r--r--pkg/systemdgen/systemdgen.go4
-rw-r--r--pkg/systemdgen/systemdgen_test.go4
-rw-r--r--test/e2e/generate_systemd_test.go2
3 files changed, 5 insertions, 5 deletions
diff --git a/pkg/systemdgen/systemdgen.go b/pkg/systemdgen/systemdgen.go
index b6167a23e..745b708e4 100644
--- a/pkg/systemdgen/systemdgen.go
+++ b/pkg/systemdgen/systemdgen.go
@@ -96,8 +96,8 @@ Restart={{.RestartPolicy}}
{{- if .New}}
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStart={{.RunCommand}}
-ExecStop={{.Executable}} stop --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
-ExecStopPost={{.Executable}} rm -f --cidfile /%t/%n-cid
+ExecStop={{.Executable}} stop --ignore --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
+ExecStopPost={{.Executable}} rm --ignore -f --cidfile /%t/%n-cid
PIDFile=/%t/%n-pid
{{- else}}
ExecStart={{.Executable}} start {{.ContainerName}}
diff --git a/pkg/systemdgen/systemdgen_test.go b/pkg/systemdgen/systemdgen_test.go
index 3894a0205..9c6933d17 100644
--- a/pkg/systemdgen/systemdgen_test.go
+++ b/pkg/systemdgen/systemdgen_test.go
@@ -123,8 +123,8 @@ Documentation=man:podman-generate-systemd(1)
Restart=always
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStart=/usr/bin/podman run --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN
-ExecStop=/usr/bin/podman stop --cidfile /%t/%n-cid -t 42
-ExecStopPost=/usr/bin/podman rm -f --cidfile /%t/%n-cid
+ExecStop=/usr/bin/podman stop --ignore --cidfile /%t/%n-cid -t 42
+ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile /%t/%n-cid
PIDFile=/%t/%n-pid
KillMode=none
Type=forking
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index f0fef41a4..d0dadd09d 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -191,7 +191,7 @@ var _ = Describe("Podman generate systemd", func() {
found, _ := session.GrepString("# container-foo.service")
Expect(found).To(BeTrue())
- found, _ = session.GrepString("stop --cidfile /%t/%n-cid -t 42")
+ found, _ = session.GrepString("stop --ignore --cidfile /%t/%n-cid -t 42")
Expect(found).To(BeTrue())
})