From cea9205136b25711b5517454a102068b4ae3c544 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 14 Aug 2019 22:59:52 +0200 Subject: [PATCH] Use start_daemon to start pihole-FTL. Signed-off-by: DL6ER --- advanced/Templates/pihole-FTL.service | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/advanced/Templates/pihole-FTL.service b/advanced/Templates/pihole-FTL.service index 5b11b83f..df3427a3 100644 --- a/advanced/Templates/pihole-FTL.service +++ b/advanced/Templates/pihole-FTL.service @@ -12,6 +12,8 @@ FTLUSER=pihole PIDFILE=/var/run/pihole-FTL.pid +. /lib/lsb/init-functions + get_pid() { pidof "pihole-FTL" } @@ -38,10 +40,10 @@ start() { chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.piholeFTL if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN+eip "$(which pihole-FTL)"; then - su -s /bin/sh -c "/usr/bin/pihole-FTL" "$FTLUSER" + start_daemon -p "${PIDFILE}" /usr/bin/su -s /bin/sh -c "/usr/bin/pihole-FTL -f" "$FTLUSER" & else echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system" - pihole-FTL + start_daemon -p "${PIDFILE}" "/usr/bin/pihole-FTL" -f & fi echo fi