1
0
mirror of https://github.com/pi-hole/pi-hole.git synced 2025-09-20 17:11:17 +08:00

Give FTL 60 seconds for graceful shutdown

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König
2025-04-21 09:43:07 +02:00
parent 60485fdc51
commit 842afc2475
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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