Commit 22829662 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add initial openrc support

parent 35e2e84b
......@@ -71,7 +71,7 @@ case $DISTRNAME in
# CMD="pkg_add"
# ;;
# Gentoo)
# CMD="emerge"
# CMD="eselect"
# ;;
# ArchLinux)
# CMD="pacman"
......
......@@ -42,6 +42,9 @@ serv_disable()
systemd)
sudocmd systemctl disable $1
;;
openrc)
sudocmd rc-update del $1 default
;;
runit)
sudocmd rm -fv /var/service/$SERVICE
;;
......
......@@ -46,6 +46,9 @@ __serv_enable()
systemd)
sudocmd systemctl enable $1
;;
openrc)
sudocmd rc-update add $1 default
;;
runit)
epm assure $SERVICE
[ -r "/etc/sv/$SERVICE" ] || fatal "Can't find /etc/sv/$SERVICE"
......
......@@ -33,6 +33,9 @@ serv_list()
systemd)
sudocmd systemctl list-units $@
;;
openrc)
sudocmd rc-status
;;
*)
# hack to improve list speed
[ "$UID" = 0 ] || { sudocmd $PROGDIR/serv --quiet list ; return ; }
......
......@@ -36,6 +36,9 @@ serv_list_all()
systemd)
sudocmd systemctl list-unit-files $@
;;
openrc)
sudocmd rc-service -l
;;
*)
fatal "Have no suitable command for $SERVICETYPE"
;;
......
......@@ -42,6 +42,9 @@ serv_restart()
runit)
sudocmd sv restart "$SERVICE"
;;
openrc)
sudocmd rc-service restart "$SERVICE"
;;
*)
fatal "Have no suitable command for $SERVICETYPE"
;;
......
......@@ -40,6 +40,9 @@ serv_start()
runit)
sudocmd sv up "$SERVICE"
;;
openrc)
sudocmd rc-service start "$SERVICE"
;;
*)
fatal "Have no suitable command for $SERVICETYPE"
;;
......
......@@ -40,6 +40,9 @@ serv_stop()
runit)
sudocmd sv down "$SERVICE"
;;
openrc)
sudocmd rc-service stop "$SERVICE"
;;
*)
fatal "Have no suitable command for $SERVICETYPE"
;;
......
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