Use start_daemon to start pihole-FTL.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-08-14 22:59:52 +02:00
parent 0cc1e88608
commit cea9205136

View File

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