mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #4884 from vrothberg/systemd-ignore
systemdgen: add --ignore flag to generic services
This commit is contained in:
@ -96,8 +96,8 @@ Restart={{.RestartPolicy}}
|
|||||||
{{- if .New}}
|
{{- if .New}}
|
||||||
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||||
ExecStart={{.RunCommand}}
|
ExecStart={{.RunCommand}}
|
||||||
ExecStop={{.Executable}} stop --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
|
ExecStop={{.Executable}} stop --ignore --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
|
||||||
ExecStopPost={{.Executable}} rm -f --cidfile /%t/%n-cid
|
ExecStopPost={{.Executable}} rm --ignore -f --cidfile /%t/%n-cid
|
||||||
PIDFile=/%t/%n-pid
|
PIDFile=/%t/%n-pid
|
||||||
{{- else}}
|
{{- else}}
|
||||||
ExecStart={{.Executable}} start {{.ContainerName}}
|
ExecStart={{.Executable}} start {{.ContainerName}}
|
||||||
|
@ -123,8 +123,8 @@ Documentation=man:podman-generate-systemd(1)
|
|||||||
Restart=always
|
Restart=always
|
||||||
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
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
|
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
|
ExecStop=/usr/bin/podman stop --ignore --cidfile /%t/%n-cid -t 42
|
||||||
ExecStopPost=/usr/bin/podman rm -f --cidfile /%t/%n-cid
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile /%t/%n-cid
|
||||||
PIDFile=/%t/%n-pid
|
PIDFile=/%t/%n-pid
|
||||||
KillMode=none
|
KillMode=none
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -191,7 +191,7 @@ var _ = Describe("Podman generate systemd", func() {
|
|||||||
found, _ := session.GrepString("# container-foo.service")
|
found, _ := session.GrepString("# container-foo.service")
|
||||||
Expect(found).To(BeTrue())
|
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())
|
Expect(found).To(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user