mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-07-28 08:04:11 +02:00
Give FTL 60 seconds for graceful shutdown (#6187)
This commit is contained in:
commit
1bdbc26a07
@ -12,6 +12,7 @@
|
|||||||
# Source utils.sh for getFTLConfigValue(), getFTLPID()
|
# Source utils.sh for getFTLConfigValue(), getFTLPID()
|
||||||
PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
||||||
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
||||||
|
# shellcheck source="./advanced/Scripts/utils.sh"
|
||||||
. "${utilsfile}"
|
. "${utilsfile}"
|
||||||
|
|
||||||
|
|
||||||
@ -56,13 +57,16 @@ start() {
|
|||||||
stop() {
|
stop() {
|
||||||
if is_running; then
|
if is_running; then
|
||||||
kill "${FTL_PID}"
|
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
|
if ! is_running; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "."
|
printf "."
|
||||||
sleep 1
|
sleep 1
|
||||||
|
i=$((i + 1))
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ ExecReload=/bin/kill -HUP $MAINPID
|
|||||||
ExecStopPost=/opt/pihole/pihole-FTL-poststop.sh
|
ExecStopPost=/opt/pihole/pihole-FTL-poststop.sh
|
||||||
|
|
||||||
# Use graceful shutdown with a reasonable timeout
|
# Use graceful shutdown with a reasonable timeout
|
||||||
TimeoutStopSec=10s
|
TimeoutStopSec=60s
|
||||||
|
|
||||||
# Make /usr, /boot, /etc and possibly some more folders read-only...
|
# Make /usr, /boot, /etc and possibly some more folders read-only...
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
Loading…
x
Reference in New Issue
Block a user