diff options
-rw-r--r-- | pkg/systemd/generate/systemdgen.go | 8 | ||||
-rw-r--r-- | pkg/systemd/generate/systemdgen_test.go | 24 | ||||
-rw-r--r-- | test/e2e/generate_systemd_test.go | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/pkg/systemd/generate/systemdgen.go b/pkg/systemd/generate/systemdgen.go index 538e54ec9..fb0ea5cf9 100644 --- a/pkg/systemd/generate/systemdgen.go +++ b/pkg/systemd/generate/systemdgen.go @@ -101,10 +101,10 @@ Before={{- range $index, $value := .RequiredServices -}}{{if $index}} {{end}}{{ Environment={{.EnvVariable}}=%n Restart={{.RestartPolicy}} {{- if .New}} -ExecStartPre=/usr/bin/rm -f %t/%n-pid %t/%n-cid +ExecStartPre=/usr/bin/rm -f %t/%n-pid %t/%n-ctr-id ExecStart={{.RunCommand}} -ExecStop={{.Executable}} stop --ignore --cidfile %t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}} -ExecStopPost={{.Executable}} rm --ignore -f --cidfile %t/%n-cid +ExecStop={{.Executable}} stop --ignore --cidfile %t/%n-ctr-id {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}} +ExecStopPost={{.Executable}} rm --ignore -f --cidfile %t/%n-ctr-id PIDFile=%t/%n-pid {{- else}} ExecStart={{.Executable}} start {{.ContainerName}} @@ -168,7 +168,7 @@ func CreateContainerSystemdUnit(info *ContainerInfo, opts Options) (string, erro info.Executable, "run", "--conmon-pidfile", "%t/%n-pid", - "--cidfile", "%t/%n-cid", + "--cidfile", "%t/%n-ctr-id", "--cgroups=no-conmon", } diff --git a/pkg/systemd/generate/systemdgen_test.go b/pkg/systemd/generate/systemdgen_test.go index cc5db5e24..9da261a69 100644 --- a/pkg/systemd/generate/systemdgen_test.go +++ b/pkg/systemd/generate/systemdgen_test.go @@ -136,10 +136,10 @@ After=network-online.target [Service] Environment=PODMAN_SYSTEMD_UNIT=%n 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 --cgroups=no-conmon -d --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN -ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-cid -t 42 -ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid +ExecStartPre=/usr/bin/rm -f %t/%n-pid %t/%n-ctr-id +ExecStart=/usr/bin/podman run --conmon-pidfile %t/%n-pid --cidfile %t/%n-ctr-id --cgroups=no-conmon -d --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN +ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 42 +ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id PIDFile=%t/%n-pid KillMode=none Type=forking @@ -159,10 +159,10 @@ After=network-online.target [Service] Environment=PODMAN_SYSTEMD_UNIT=%n 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 --cgroups=no-conmon --detach --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN -ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-cid -t 42 -ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid +ExecStartPre=/usr/bin/rm -f %t/%n-pid %t/%n-ctr-id +ExecStart=/usr/bin/podman run --conmon-pidfile %t/%n-pid --cidfile %t/%n-ctr-id --cgroups=no-conmon --detach --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN +ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 42 +ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id PIDFile=%t/%n-pid KillMode=none Type=forking @@ -182,10 +182,10 @@ After=network-online.target [Service] Environment=PODMAN_SYSTEMD_UNIT=%n 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 --cgroups=no-conmon -d awesome-image:latest -ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-cid -t 10 -ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid +ExecStartPre=/usr/bin/rm -f %t/%n-pid %t/%n-ctr-id +ExecStart=/usr/bin/podman run --conmon-pidfile %t/%n-pid --cidfile %t/%n-ctr-id --cgroups=no-conmon -d awesome-image:latest +ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 10 +ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id 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 d5ae441e2..64d220776 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 --ignore --cidfile %t/%n-cid -t 42") + found, _ = session.GrepString("stop --ignore --cidfile %t/%n-ctr-id -t 42") Expect(found).To(BeTrue()) }) |