From 2b27fa217bdc3f8fc0dae9aee366294dfe9c94a4 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:18:26 -0500 Subject: [PATCH] replace runit with sv sv works with runit, and we don't need to sleep command. --- core/tabs/common-service-script.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 0020b064..4e3e0ef0 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -23,7 +23,7 @@ startService() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start ;; - runit) + sv) "$ESCALATION_TOOL" sv start "$1" ;; esac @@ -37,7 +37,7 @@ stopService() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop ;; - runit) + sv) "$ESCALATION_TOOL" sv stop "$1" ;; esac @@ -51,10 +51,8 @@ enableService() { rc-service) "$ESCALATION_TOOL" rc-update add "$1" ;; - runit) + sv) "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" - printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}" - sleep 5 ;; esac } @@ -67,7 +65,7 @@ disableService() { rc-service) "$ESCALATION_TOOL" rc-update del "$1" ;; - runit) + sv) "$ESCALATION_TOOL" rm -f "/var/service/$1" ;; esac @@ -78,7 +76,7 @@ startAndEnableService() { systemctl) "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" ;; - rc-service | runit) + rc-service | sv) enableService "$1" startService "$1" ;; @@ -93,10 +91,10 @@ isServiceActive() { rc-service) "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet ;; - runit) + sv) "$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1 ;; esac } -checkInitManager 'systemctl rc-service runit' +checkInitManager 'systemctl rc-service sv'