Fix to ensure systemd is the active init system #2022

This commit is contained in:
Ilia Ross
2023-10-11 18:43:47 +03:00
parent 2e63031e22
commit 873490367d
2 changed files with 13 additions and 1 deletions

View File

@@ -661,7 +661,13 @@ if [ ! -f "$config_dir/.pre-install" ]; then
fi
# Test if we have systemd system
systemctlcmd=`which systemctl 2>/dev/null`
systemctlcmd=$(which systemctl 2>/dev/null)
if [ -x "$systemctlcmd" ]; then
initsys=$(cat /proc/1/comm 2>/dev/null)
if [ "$initsys" != "systemd" ]; then
systemctlcmd=""
fi
fi
# Re-generating main scripts
echo "Creating start and stop init scripts .."