mirror of https://github.com/containers/podman.git
generate systemd: rename "cid" to "ctr-id"
Rename the container ID file from "cid" to "ctr-id" to make the generated unit files a) easier to read and to b) pro-actively avoid any confusion when pod ID files are being added in the future. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
parent
cf89bb6711
commit
144c6bb76d
|
@ -101,10 +101,10 @@ Before={{- range $index, $value := .RequiredServices -}}{{if $index}} {{end}}{{
|
||||||
Environment={{.EnvVariable}}=%n
|
Environment={{.EnvVariable}}=%n
|
||||||
Restart={{.RestartPolicy}}
|
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-ctr-id
|
||||||
ExecStart={{.RunCommand}}
|
ExecStart={{.RunCommand}}
|
||||||
ExecStop={{.Executable}} stop --ignore --cidfile %t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
|
ExecStop={{.Executable}} stop --ignore --cidfile %t/%n-ctr-id {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
|
||||||
ExecStopPost={{.Executable}} rm --ignore -f --cidfile %t/%n-cid
|
ExecStopPost={{.Executable}} rm --ignore -f --cidfile %t/%n-ctr-id
|
||||||
PIDFile=%t/%n-pid
|
PIDFile=%t/%n-pid
|
||||||
{{- else}}
|
{{- else}}
|
||||||
ExecStart={{.Executable}} start {{.ContainerName}}
|
ExecStart={{.Executable}} start {{.ContainerName}}
|
||||||
|
@ -168,7 +168,7 @@ func CreateContainerSystemdUnit(info *ContainerInfo, opts Options) (string, erro
|
||||||
info.Executable,
|
info.Executable,
|
||||||
"run",
|
"run",
|
||||||
"--conmon-pidfile", "%t/%n-pid",
|
"--conmon-pidfile", "%t/%n-pid",
|
||||||
"--cidfile", "%t/%n-cid",
|
"--cidfile", "%t/%n-ctr-id",
|
||||||
"--cgroups=no-conmon",
|
"--cgroups=no-conmon",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,10 +136,10 @@ After=network-online.target
|
||||||
[Service]
|
[Service]
|
||||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||||
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-ctr-id
|
||||||
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
|
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-cid -t 42
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 42
|
||||||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id
|
||||||
PIDFile=%t/%n-pid
|
PIDFile=%t/%n-pid
|
||||||
KillMode=none
|
KillMode=none
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -159,10 +159,10 @@ After=network-online.target
|
||||||
[Service]
|
[Service]
|
||||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||||
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-ctr-id
|
||||||
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
|
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-cid -t 42
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 42
|
||||||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id
|
||||||
PIDFile=%t/%n-pid
|
PIDFile=%t/%n-pid
|
||||||
KillMode=none
|
KillMode=none
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -182,10 +182,10 @@ After=network-online.target
|
||||||
[Service]
|
[Service]
|
||||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||||
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-ctr-id
|
||||||
ExecStart=/usr/bin/podman run --conmon-pidfile %t/%n-pid --cidfile %t/%n-cid --cgroups=no-conmon -d awesome-image:latest
|
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-cid -t 10
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n-ctr-id -t 10
|
||||||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-cid
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n-ctr-id
|
||||||
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 --ignore --cidfile %t/%n-cid -t 42")
|
found, _ = session.GrepString("stop --ignore --cidfile %t/%n-ctr-id -t 42")
|
||||||
Expect(found).To(BeTrue())
|
Expect(found).To(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue