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

is_active_systemd: rewrite systemd detection

parent 3d1ac884
......@@ -554,18 +554,16 @@ esac
PMTYPE=$CMD
}
# https://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
is_active_systemd()
{
local a
SYSTEMCTL=/bin/systemctl
SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
[ -x "$SYSTEMCTL" ] || return
[ -d "$SYSTEMD_CGROUP_DIR" ] || return
#a='' mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
cat /proc/1/cmdline | grep -q 'systemd' && return
cat /proc/1/cmdline | grep -q '/sbin/init' || return
readlink /sbin/init | grep -q 'systemd' || return
#[ -x "$SYSTEMCTL" ] || return
[ -d /run/systemd/system ] || return
#SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
#[ -d "$SYSTEMD_CGROUP_DIR" ] || return
#cat /proc/1/comm | grep -q 'systemd' && return
}
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