From 1834f9a1081b18f234d035edaacea989e50e9788 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 22 Aug 2022 20:06:02 -0500 Subject: [PATCH] r/bitwarden_rs: Remove dangling container at start If the *vaultwarden* service terminates unexpectedly, e.g. due to a power loss, `podman` may not successfully remove the container. We therefore need to try to delete it before starting it again, or `podman` will exit with an error because the container already exists. --- roles/bitwarden_rs/templates/vaultwarden.service.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/bitwarden_rs/templates/vaultwarden.service.j2 b/roles/bitwarden_rs/templates/vaultwarden.service.j2 index ad47ba5..001adbd 100644 --- a/roles/bitwarden_rs/templates/vaultwarden.service.j2 +++ b/roles/bitwarden_rs/templates/vaultwarden.service.j2 @@ -4,6 +4,7 @@ Description=Vaultwarden API server [Service] Type=notify NotifyAccess=all +ExecStartPre=-/usr/bin/podman container rm --force --ignore vaultwarden ExecStart=/usr/bin/podman run \ --pull never \ --sdnotify=conmon --cgroups=no-conmon \