diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-05 14:16:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 14:16:47 -0500 |
commit | 1f59276998320e1961eb9ac63092415f78fe1aa0 (patch) | |
tree | 84385fa229912fbda314ec2435b0ef3b41b536c9 /pkg/systemd/generate/pods.go | |
parent | b84b7c89bb35883efebbc1ace0d1bce7e1847632 (diff) | |
parent | 219c69ef03dc86aa92b6134a03f22f416b954d86 (diff) | |
download | podman-1f59276998320e1961eb9ac63092415f78fe1aa0.tar.gz podman-1f59276998320e1961eb9ac63092415f78fe1aa0.tar.bz2 podman-1f59276998320e1961eb9ac63092415f78fe1aa0.zip |
Merge pull request #8889 from vrothberg/run-1138
generate systemd: do not set `KillMode`
Diffstat (limited to 'pkg/systemd/generate/pods.go')
-rw-r--r-- | pkg/systemd/generate/pods.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go index 3c57b03fb..fc582e42a 100644 --- a/pkg/systemd/generate/pods.go +++ b/pkg/systemd/generate/pods.go @@ -60,6 +60,8 @@ type podInfo struct { ExecStartPre2 string // ExecStart of the unit. ExecStart string + // TimeoutStopSec of the unit. + TimeoutStopSec uint // ExecStop of the unit. ExecStop string // ExecStopPost of the unit. @@ -72,6 +74,7 @@ Before={{- range $index, $value := .RequiredServices -}}{{if $index}} {{end}}{{ [Service] Environment={{.EnvVariable}}=%n Restart={{.RestartPolicy}} +TimeoutStopSec={{.TimeoutStopSec}} {{- if .ExecStartPre1}} ExecStartPre={{.ExecStartPre1}} {{- end}} @@ -82,7 +85,6 @@ ExecStart={{.ExecStart}} ExecStop={{.ExecStop}} ExecStopPost={{.ExecStopPost}} PIDFile={{.PIDFile}} -KillMode=none Type=forking [Install] @@ -298,6 +300,8 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions) info.ExecStop = "{{.Executable}} pod stop --ignore --pod-id-file {{.PodIDFile}} {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}" info.ExecStopPost = "{{.Executable}} pod rm --ignore -f --pod-id-file {{.PodIDFile}}" } + info.TimeoutStopSec = minTimeoutStopSec + info.StopTimeout + if info.PodmanVersion == "" { info.PodmanVersion = version.Version.String() } |