mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-18 06:08:21 +00:00
Merge pull request #2378 from pi-hole/fix/pihole-FTL-no-caps
Start pihole-FTL as root if capabilities are not supported by the system
This commit is contained in:
commit
b9d47d0dd2
@ -39,9 +39,13 @@ start() {
|
|||||||
chown pihole:pihole /etc/pihole /etc/pihole/dhcp.leases
|
chown pihole:pihole /etc/pihole /etc/pihole/dhcp.leases
|
||||||
chown pihole:pihole /var/log/pihole-FTL.log /var/log/pihole.log
|
chown pihole:pihole /var/log/pihole-FTL.log /var/log/pihole.log
|
||||||
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
|
||||||
setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN+eip "$(which pihole-FTL)"
|
|
||||||
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
|
||||||
su -s /bin/sh -c "/usr/bin/pihole-FTL" "$FTLUSER"
|
su -s /bin/sh -c "/usr/bin/pihole-FTL" "$FTLUSER"
|
||||||
|
else
|
||||||
|
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system"
|
||||||
|
pihole-FTL
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user