mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
container/pod id file: truncate instead of throwing an error
Truncate the container and pod ID files instead of throwing an error. The main motivation is to prevent redundant work when starting systemd units. Throwing an error when the file already exists is not preventing races or file corruptions, so let's leave that to the user which in almost all cases are generated (and tested) systemd units. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -258,8 +258,6 @@ Before=
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStartPre=/bin/rm \
|
||||
-f %t/pod-123abc.pid %t/pod-123abc.pod-id
|
||||
ExecStartPre=/usr/bin/podman pod create \
|
||||
--infra-conmon-pidfile %t/pod-123abc.pid \
|
||||
--pod-id-file %t/pod-123abc.pod-id \
|
||||
@ -326,8 +324,6 @@ Before=container-1.service container-2.service
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStartPre=/bin/rm \
|
||||
-f %t/pod-123abc.pid %t/pod-123abc.pod-id
|
||||
ExecStartPre=/usr/bin/podman pod create \
|
||||
--infra-conmon-pidfile %t/pod-123abc.pid \
|
||||
--pod-id-file %t/pod-123abc.pod-id \
|
||||
@ -367,8 +363,6 @@ Before=container-1.service container-2.service
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStartPre=/bin/rm \
|
||||
-f %t/pod-123abc.pid %t/pod-123abc.pod-id
|
||||
ExecStartPre=/usr/bin/podman \
|
||||
--events-backend none \
|
||||
--runroot /root pod create \
|
||||
@ -410,8 +404,6 @@ Before=container-1.service container-2.service
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStartPre=/bin/rm \
|
||||
-f %t/pod-123abc.pid %t/pod-123abc.pod-id
|
||||
ExecStartPre=/usr/bin/podman pod create \
|
||||
--infra-conmon-pidfile %t/pod-123abc.pid \
|
||||
--pod-id-file %t/pod-123abc.pod-id \
|
||||
@ -451,8 +443,6 @@ Before=container-1.service container-2.service
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStartPre=/bin/rm \
|
||||
-f %t/pod-123abc.pid %t/pod-123abc.pod-id
|
||||
ExecStartPre=/usr/bin/podman pod create \
|
||||
--infra-conmon-pidfile %t/pod-123abc.pid \
|
||||
--pod-id-file %t/pod-123abc.pod-id \
|
||||
|
Reference in New Issue
Block a user