From dd8e3dcdd82bbf54d64bd532fb18269b8cefee29 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 21 Jun 2022 14:18:32 +0200 Subject: [PATCH] start.sh: exit when any of the background processes quit This will terminate the docker container when any of the processes (pdns_server or inotifywait) fails. --- start.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index e7502a2..ed8bf9f 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash /usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no & @@ -8,4 +8,8 @@ inotifywait -mqre modify --exclude '\.git' --format '%w%f' "/var/lib/powerdns/zo echo [$0] A modification was detected in $path echo [$0] Executing \`/usr/bin/pdns_control bind-reload-now $zone\` /usr/bin/pdns_control bind-reload-now $zone - done + done & + +wait -n + +exit $?