Commit c5538e12 authored by Vitaly Lipatov's avatar Vitaly Lipatov

check if systemd is active

parent 435acebb
......@@ -66,7 +66,7 @@ __update_alt_repo_to_next_distro()
docmd epm install apt rpm apt-conf-branch || fatal
__replace_text_in_alt_repo "/^ *#/! s!\[updates\]![p7]!g"
docmd epm update || fatal
if is_installed systemd ; then
if is_installed systemd && is_active_systemd systemd ; then
docmd epm install systemd || fatal
fi
docmd epm upgrade || fatal
......
......@@ -476,3 +476,15 @@ esac
PMTYPE=$CMD
}
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
# some hack
pidof systemd >/dev/null
}
......@@ -54,18 +54,6 @@ set_service_type()
[ -n "$DISTRVERSION" ] || DISTRVERSION=$($DISTRVENDOR -v)
set_target_pkg_env
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
# some hack
pidof systemd >/dev/null
}
case $DISTRNAME in
ALTLinux)
CMD="service-chkconfig"
......
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