From: Guillaume Abrioux Date: Tue, 21 Jul 2020 18:27:28 +0000 (+0200) Subject: crash: rm container in ExecPreStart even with docker X-Git-Tag: v5.0.2~107 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0b32e4a7949d9e75eab5de7776c6688c49bbda8;p=ceph-ansible.git crash: rm container in ExecPreStart even with docker We should ensure the container is removed in `ExecPreStart` even when `{{ container_binary }}` is docker. Signed-off-by: Guillaume Abrioux (cherry picked from commit 39bb279a53deaf87053cae4014c7143780016536) --- diff --git a/roles/ceph-crash/templates/ceph-crash.service.j2 b/roles/ceph-crash/templates/ceph-crash.service.j2 index ed06ef077..94db16a3d 100644 --- a/roles/ceph-crash/templates/ceph-crash.service.j2 +++ b/roles/ceph-crash/templates/ceph-crash.service.j2 @@ -10,8 +10,8 @@ After=network.target [Service] {% if container_binary == 'podman' %} ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid -ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-crash-%i {% endif %} +ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-crash-%i ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-crash-%i \ {% if container_binary == 'podman' %} -d --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \