Commit 238c48e1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

is_active_systemd: rewrite systemd detection

parent 3d1ac884
...@@ -554,18 +554,16 @@ esac ...@@ -554,18 +554,16 @@ esac
PMTYPE=$CMD PMTYPE=$CMD
} }
# https://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
is_active_systemd() is_active_systemd()
{ {
local a local a
SYSTEMCTL=/bin/systemctl SYSTEMCTL=/bin/systemctl
SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd #[ -x "$SYSTEMCTL" ] || return
[ -x "$SYSTEMCTL" ] || return [ -d /run/systemd/system ] || return
[ -d "$SYSTEMD_CGROUP_DIR" ] || return #SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
#a='' mountpoint -q "$SYSTEMD_CGROUP_DIR" || return #[ -d "$SYSTEMD_CGROUP_DIR" ] || return
cat /proc/1/cmdline | grep -q 'systemd' && return #cat /proc/1/comm | grep -q 'systemd' && return
cat /proc/1/cmdline | grep -q '/sbin/init' || return
readlink /sbin/init | grep -q 'systemd' || return
} }
assure_distr() assure_distr()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment