Fix systemd detection logic

This commit is contained in:
Kyle Robbertze 2019-02-18 13:04:08 +02:00
parent 916cc35058
commit b5325f45ff
1 changed files with 2 additions and 2 deletions

View File

@ -152,11 +152,11 @@ function systemInitDetect() {
# Get package of PID=1 path as it identifies the init system.
# Allow this to fail, at least then the init system can be guessed from the
# PID 1 executable alone
pid_1_package=$(dpkg -S $pid_1_path 2>/dev/null ||
pid_1_package=$(dpkg -S $pid_1_path 2>/dev/null ||
rpm --qf '%{name}\n' -qf $pid_1_path 2>/dev/null ||
echo "unknown")
verbose "Detected package name for PID=1 process: $pid_1_package"
case "${pid_1_package:$pid_1_path}" in
case "${pid_1_package}:${pid_1_path}" in
*systemd*) has_systemd_init=true; verbose "Detected init system type: systemd" ;;
*upstart*) has_upstart_init=true; verbose "Detected init system type: Upstart" ;;
*sysvinit*) has_systemv_init=true; verbose "Detected init system type: System V" ;;