nixos/oci-containers: ignore nonexistent container when stopping

Fixes #292551
This commit is contained in:
Diogo Correia 2024-03-01 10:41:00 +00:00
parent b5f6e3881a
commit 81f21e3936
No known key found for this signature in database
GPG Key ID: 12B4F3AC9C065D08

View File

@ -312,7 +312,7 @@ let
preStop = if cfg.backend == "podman"
then "podman stop --ignore --cidfile=/run/podman-${escapedName}.ctr-id"
else "${cfg.backend} stop ${name}";
else "${cfg.backend} stop ${name} || true";
postStop = if cfg.backend == "podman"
then "podman rm -f --ignore --cidfile=/run/podman-${escapedName}.ctr-id"