diff --git a/advanced/Templates/pihole-FTL.service b/advanced/Templates/pihole-FTL.service index 6cb3e09a..7c7e9962 100644 --- a/advanced/Templates/pihole-FTL.service +++ b/advanced/Templates/pihole-FTL.service @@ -12,6 +12,7 @@ # Source utils.sh for getFTLConfigValue(), getFTLPID() PI_HOLE_SCRIPT_DIR="/opt/pihole" utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" . "${utilsfile}" @@ -56,13 +57,16 @@ start() { stop() { if is_running; then kill "${FTL_PID}" - for i in 1 2 3 4 5; do + # Give FTL 60 seconds to gracefully stop + i=1 + while [ "${i}" -le 60 ]; do if ! is_running; then break fi printf "." sleep 1 + i=$((i + 1)) done echo diff --git a/advanced/Templates/pihole-FTL.systemd b/advanced/Templates/pihole-FTL.systemd index 0a3d270e..fcbb8d8d 100644 --- a/advanced/Templates/pihole-FTL.systemd +++ b/advanced/Templates/pihole-FTL.systemd @@ -28,7 +28,7 @@ ExecReload=/bin/kill -HUP $MAINPID ExecStopPost=/opt/pihole/pihole-FTL-poststop.sh # Use graceful shutdown with a reasonable timeout -TimeoutStopSec=10s +TimeoutStopSec=60s # Make /usr, /boot, /etc and possibly some more folders read-only... ProtectSystem=full