1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-01-03 12:40:56 +00:00

Merge pull request #2767 from pi-hole/fix/multiple_pihole-FTL_PIDs

Improve PID detection in pihole-FTL.service
This commit is contained in:
Mark Drobnak 2019-06-01 01:03:55 -04:00 committed by GitHub
commit afd28fab03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,14 @@ FTLUSER=pihole
PIDFILE=/var/run/pihole-FTL.pid PIDFILE=/var/run/pihole-FTL.pid
get_pid() { get_pid() {
pidof "pihole-FTL" # First, try to obtain PID from PIDFILE
if [ -s "${PIDFILE}" ]; then
cat "${PIDFILE}"
return
fi
# If the PIDFILE is empty or not available, obtain the PID using pidof
pidof "pihole-FTL" | awk '{print $(NF)}'
} }
is_running() { is_running() {