Use start_daemon to start pihole-FTL.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
FTLUSER=pihole
|
FTLUSER=pihole
|
||||||
PIDFILE=/var/run/pihole-FTL.pid
|
PIDFILE=/var/run/pihole-FTL.pid
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
get_pid() {
|
get_pid() {
|
||||||
pidof "pihole-FTL"
|
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
|
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
|
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
|
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
|
else
|
||||||
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system"
|
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
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user