From 81f21e39368705ec725a1aec7dc885b64930578c Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Fri, 1 Mar 2024 10:41:00 +0000 Subject: [PATCH] nixos/oci-containers: ignore nonexistent container when stopping Fixes #292551 --- nixos/modules/virtualisation/oci-containers.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/oci-containers.nix b/nixos/modules/virtualisation/oci-containers.nix index a88715587d65..5bffb3f04716 100644 --- a/nixos/modules/virtualisation/oci-containers.nix +++ b/nixos/modules/virtualisation/oci-containers.nix @@ -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"