1
0

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.
This commit is contained in:
Pim van den Berg 2022-06-21 14:18:32 +02:00
parent 21b4e29176
commit dd8e3dcdd8

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no & /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] A modification was detected in $path
echo [$0] Executing \`/usr/bin/pdns_control bind-reload-now $zone\` echo [$0] Executing \`/usr/bin/pdns_control bind-reload-now $zone\`
/usr/bin/pdns_control bind-reload-now $zone /usr/bin/pdns_control bind-reload-now $zone
done done &
wait -n
exit $?