Use a more general method to determine whether systemd is the init system

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-03-03 20:16:07 +01:00
parent edf336067a
commit bef8227cbd
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -1281,8 +1281,7 @@ installConfigs() {
fi
# Install pihole-FTL systemd or init.d service, based on whether systemd is the init system or not
# Follow debhelper logic, which checks for /run/systemd/system to derive whether systemd is the init system
if [[ -d '/run/systemd/system' ]]; then
if ps -p 1 -o comm= | grep -q systemd; then
install -T -m 0644 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.systemd" '/etc/systemd/system/pihole-FTL.service'
# Remove init.d service if present