Skip to content

Commit

Permalink
quadlet: Drop ExecStartPre=rm %t/%N.cid
Browse files Browse the repository at this point in the history
Since #16394 was merged
we now always delete the cid file if --replace=true was specified,
so we can avoid this extra command being launched.

[NO NEW TESTS NEEDED] Already tested in above PR.

Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Dec 5, 2022
1 parent 3ed4482 commit f3c5b0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
// Need the containers filesystem mounted to start podman
service.Add(UnitGroup, "RequiresMountsFor", "%t/containers")

// Remove any leftover cid file before starting, just to be sure.
// We remove any actual pre-existing container by name with --replace=true.
// But --cidfile will fail if the target exists.
service.Add(ServiceGroup, "ExecStartPre", "-rm -f %t/%N.cid")

// If the conman exited uncleanly it may not have removed the container, so force it,
// -i makes it ignore non-existing files.
service.Add(ServiceGroup, "ExecStopPost", "-/usr/bin/podman rm -f -i --cidfile=%t/%N.cid")
Expand Down
1 change: 0 additions & 1 deletion test/e2e/quadlet/basic.container
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
## assert-key-is "Service" "Type" "notify"
## assert-key-is "Service" "NotifyAccess" "all"
## assert-key-is "Service" "SyslogIdentifier" "%N"
## assert-key-is "Service" "ExecStartPre" "-rm -f %t/%N.cid"
## assert-key-is "Service" "ExecStopPost" "-/usr/bin/podman rm -f -i --cidfile=%t/%N.cid" "-rm -f %t/%N.cid"
## assert-key-is "Service" "Environment" "PODMAN_SYSTEMD_UNIT=%n"

Expand Down

0 comments on commit f3c5b0f

Please sign in to comment.