diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index c3a2053d..5828aa64 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -23,6 +23,9 @@ startService() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start ;; + runit) + "$ESCALATION_TOOL" sv start "$1" + ;; esac } @@ -34,6 +37,9 @@ stopService() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop ;; + runit) + "$ESCALATION_TOOL" sv stop "$1" + ;; esac } @@ -45,6 +51,10 @@ enableService() { rc-service) "$ESCALATION_TOOL" rc-update add "$1" ;; + runit) + "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" + sleep 5 + ;; esac } @@ -56,6 +66,9 @@ disableService() { rc-service) "$ESCALATION_TOOL" rc-update del "$1" ;; + runit) + "$ESCALATION_TOOL" rm -f "/var/service/$1" + ;; esac } @@ -64,7 +77,7 @@ startAndEnableService() { systemctl) "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" ;; - rc-service) + rc-service|runit) enableService "$1" startService "$1" ;; @@ -79,7 +92,10 @@ isServiceActive() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet ;; + runit) + "$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1 + ;; esac } -checkInitManager 'systemctl rc-service' \ No newline at end of file +checkInitManager 'systemctl rc-service runit'