diff --git a/s6/debian-root/etc/cont-init.d/20-start.sh b/s6/debian-root/etc/cont-init.d/20-start.sh index 5c92d59..39ff67f 100644 --- a/s6/debian-root/etc/cont-init.d/20-start.sh +++ b/s6/debian-root/etc/cont-init.d/20-start.sh @@ -2,7 +2,7 @@ set -e bashCmd='bash -e' -if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then +if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then set -x ; bashCmd='bash -e -x' fi @@ -11,8 +11,8 @@ fi $bashCmd /start.sh # Gotta go fast, no time for gravity -if [ -n "$PYTEST" ]; then - sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)" +if [ -n "$PYTEST" ]; then + sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)" fi if [ -z "$SKIPGRAVITYONBOOT" ]; then gravity.sh @@ -21,6 +21,6 @@ else fi # Kill dnsmasq because s6 won't like it if it's running when s6 services start -kill -9 $(pgrep pihole-FTL) || true +kill -9 $(pgrep pihole-FTL) || true # TODO: REVISIT THIS SO AS TO NOT kill -9 pihole -v diff --git a/s6/debian-root/etc/services.d/pihole-FTL/finish b/s6/debian-root/etc/services.d/pihole-FTL/finish index 81c9bd9..fdeaa93 100644 --- a/s6/debian-root/etc/services.d/pihole-FTL/finish +++ b/s6/debian-root/etc/services.d/pihole-FTL/finish @@ -1,4 +1,4 @@ #!/usr/bin/with-contenv bash s6-echo "Stopping pihole-FTL" -kill -9 $(pgrep pihole-FTL) +kill -9 $(pgrep pihole-FTL) # TODO: REVISIT THIS SO AS TO NOT kill -9 diff --git a/s6/debian-root/etc/services.d/pihole-FTL/run b/s6/debian-root/etc/services.d/pihole-FTL/run index 70dbd1c..5c4f989 100644 --- a/s6/debian-root/etc/services.d/pihole-FTL/run +++ b/s6/debian-root/etc/services.d/pihole-FTL/run @@ -1,6 +1,9 @@ #!/usr/bin/with-contenv bash s6-echo "Starting pihole-FTL ($FTL_CMD) as ${DNSMASQ_USER}" +# Remove possible leftovers from previous pihole-FTL processes +rm -f /dev/shm/FTL-* 2> /dev/null +rm /run/pihole/FTL.sock 2> /dev/null s6-setuidgid ${DNSMASQ_USER} pihole-FTL $FTL_CMD >/dev/null 2>&1 # Notes on above: