Commit c6605d98 authored by Vitaly Lipatov's avatar Vitaly Lipatov

serv: add systemd detect

parent c23fefe2
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012 Etersoft # Copyright (C) 2012-2013 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2013 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -50,6 +50,13 @@ set_service_type() ...@@ -50,6 +50,13 @@ set_service_type()
[ -n "$DISTRVERSION" ] || DISTRVERSION=$($DISTRVENDOR -v) [ -n "$DISTRVERSION" ] || DISTRVERSION=$($DISTRVENDOR -v)
set_target_pkg_env set_target_pkg_env
is_active_systemd()
{
SYSTEMCTL=/bin/systemctl
SYSTEMD_CGROUP_DIR=/sys/fs/cgroup/systemd
[ -x "$SYSTEMCTL" ] && [ -d "$SYSTEMD_CGROUP_DIR" ] && mountpoint -q "$SYSTEMD_CGROUP_DIR"
}
case $DISTRNAME in case $DISTRNAME in
ALTLinux) ALTLinux)
CMD="service-chkconfig" CMD="service-chkconfig"
...@@ -85,6 +92,10 @@ case $DISTRNAME in ...@@ -85,6 +92,10 @@ case $DISTRNAME in
fatal "Do not known DISTRNAME $DISTRNAME yet" fatal "Do not known DISTRNAME $DISTRNAME yet"
;; ;;
esac esac
# Note: force systemd using if active
is_active_systemd && CMD="systemd"
SERVICETYPE=$CMD SERVICETYPE=$CMD
} }
......
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