mirror of
https://github.com/pi-hole/pi-hole
synced 2025-07-08 08:08:06 +00:00
Worked in review comments, inlined script content (we don't actually need setcap in the systemd unit as setcap is used in the installer/updater and even in the Makefile so capabilites should always be there)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
824c4cdcc9
commit
b89154ca30
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
/bin/touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
|
||||||
/bin/mkdir -p /var/run/pihole /var/log/pihole
|
|
||||||
/bin/chown pihole:pihole /var/run/pihole /var/log/pihole
|
|
||||||
if [ -e "/var/run/pihole/FTL.sock" ]; then
|
|
||||||
/bin/rm /var/run/pihole/FTL.sock
|
|
||||||
fi
|
|
||||||
/bin/chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /etc/pihole /etc/pihole/dhcp.leases /var/log/pihole.log
|
|
||||||
/bin/chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
|
||||||
/bin/echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.piholeFTL
|
|
@ -4,7 +4,6 @@ Description=Pi-hole FTLDNS
|
|||||||
; very weakly defined what that is supposed to mean, with one exception: at shutdown, a unit
|
; very weakly defined what that is supposed to mean, with one exception: at shutdown, a unit
|
||||||
; that is ordered after network.target will be stopped before the network
|
; that is ordered after network.target will be stopped before the network
|
||||||
After=network.target
|
After=network.target
|
||||||
Requires=network.target
|
|
||||||
; A target that should be used as synchronization point for all host/network name service lookups.
|
; A target that should be used as synchronization point for all host/network name service lookups.
|
||||||
; All services for which the availability of full host/network name resolution is essential should
|
; All services for which the availability of full host/network name resolution is essential should
|
||||||
; be ordered after this target, but not pull it in.
|
; be ordered after this target, but not pull it in.
|
||||||
@ -20,13 +19,19 @@ PermissionsStartOnly=true
|
|||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/run/pihole-FTL.pid
|
PIDFile=/run/pihole-FTL.pid
|
||||||
|
|
||||||
ExecStartPre=/bin/bash /opt/pihole/pihole-FTL-prestart.sh
|
ExecStartPre=/bin/touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
||||||
;ExecStartPre=/sbin/setcap cap_net_bind_service,cap_net_raw,cap_net_admin+eip /usr/bin/pihole-FTL
|
ExecStartPre=/bin/mkdir -p /var/run/pihole /var/log/pihole
|
||||||
|
ExecStartPre=/bin/chown pihole:pihole /var/run/pihole /var/log/pihole
|
||||||
|
ExecStartPre=-/bin/rm /var/run/pihole/FTL.sock
|
||||||
|
ExecStartPre=/bin/chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /etc/pihole /etc/pihole/dhcp.leases /var/log/pihole.log
|
||||||
|
ExecStartPre=/bin/chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
|
||||||
|
ExecStartPre=/bin/echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.piholeFTL
|
||||||
|
|
||||||
ExecStart=/usr/bin/pihole-FTL
|
ExecStart=/usr/bin/pihole-FTL
|
||||||
|
RestartSec=30s
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
; Use graceful shutdown with a reasonable timeout
|
; Use graceful shutdown with a reasonable timeout
|
||||||
KillMode=mixed
|
|
||||||
TimeoutStopSec=10s
|
TimeoutStopSec=10s
|
||||||
|
|
||||||
; Make /usr, /boot, /etc and possibly some more folders read-only...
|
; Make /usr, /boot, /etc and possibly some more folders read-only...
|
||||||
|
@ -1764,6 +1764,7 @@ FTLinstall() {
|
|||||||
# Remove old init.d script if present as it cannot coexist with the systemd unit we are installing here
|
# Remove old init.d script if present as it cannot coexist with the systemd unit we are installing here
|
||||||
if [ -e "/etc/init.d/pihole-FTL" ]; then
|
if [ -e "/etc/init.d/pihole-FTL" ]; then
|
||||||
rm "/etc/init.d/pihole-FTL"
|
rm "/etc/init.d/pihole-FTL"
|
||||||
|
update-rc.d pihole-FTL remove
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable service script (we have to do this after replacing the service unit)
|
# Enable service script (we have to do this after replacing the service unit)
|
||||||
|
Loading…
Reference in New Issue
Block a user