From 2b64839af283f5cc3038f42ff59ee7ba0e0b4b17 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Tue, 17 Dec 2024 18:22:39 +0100 Subject: [PATCH] Fix race in haproxy startup --- roles/lb_haproxy/files/haproxy-log-bindmount.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/lb_haproxy/files/haproxy-log-bindmount.conf b/roles/lb_haproxy/files/haproxy-log-bindmount.conf index 39ff51eb..75496d54 100644 --- a/roles/lb_haproxy/files/haproxy-log-bindmount.conf +++ b/roles/lb_haproxy/files/haproxy-log-bindmount.conf @@ -1,7 +1,7 @@ # haproxy runs in a chroot, so make sure the journald log socket is available there [Service] # fix log device (points to systemd, but needs to be in the chroot -ExecStartPre=+/bin/touch /var/lib/haproxy/dev/log +ExecStartPre=+sh -c 'test -e /var/lib/haproxy/dev/log || /bin/touch /var/lib/haproxy/dev/log' ExecStartPre=+/bin/mount -obind /run/systemd/journal/dev-log /var/lib/haproxy/dev/log ExecStopPost=-+/bin/umount /var/lib/haproxy/dev/log ExecStopPost=-+/bin/rm -f /var/lib/haproxy/dev/log