From dc61abd3bbeeb67a13c89c959bdb054450241278 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:51:53 -0500 Subject: [PATCH 1/8] Update common-service-script.sh --- core/tabs/common-service-script.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index c3a2053d0..4bb969e00 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,11 @@ enableService() { rc-service) "$ESCALATION_TOOL" rc-update add "$1" ;; + runit) + "$ESCALATION_TOOL" mkdir -p "/run/runit/supervise.$1" + "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" + sleep 2 + ;; esac } @@ -56,6 +67,9 @@ disableService() { rc-service) "$ESCALATION_TOOL" rc-update del "$1" ;; + runit) + "$ESCALATION_TOOL" rm -f "/var/service/$1" + ;; esac } @@ -68,6 +82,10 @@ startAndEnableService() { enableService "$1" startService "$1" ;; + runit) + enableService "$1" + startService "$1" + ;; esac } @@ -79,7 +97,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' From 83fee492b8834b866a1797fbc09efaef9ad3f836 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:21:31 -0500 Subject: [PATCH 2/8] Update common-service-script.sh --- core/tabs/common-service-script.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 4bb969e00..5409b1fab 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -78,11 +78,7 @@ startAndEnableService() { systemctl) "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" ;; - rc-service) - enableService "$1" - startService "$1" - ;; - runit) + rc-service|runit) enableService "$1" startService "$1" ;; From d44ce3cdb605dc541bc13de73ac1665323de3d2a Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:33:45 -0500 Subject: [PATCH 3/8] sleep for 5 to allow supervise to run --- core/tabs/common-service-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 5409b1fab..52967bca4 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -54,7 +54,7 @@ enableService() { runit) "$ESCALATION_TOOL" mkdir -p "/run/runit/supervise.$1" "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" - sleep 2 + sleep 5 ;; esac } From 5746748f520be71a3321aac0d8faa1a08425b24a Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:32:51 -0500 Subject: [PATCH 4/8] Update common-service-script.sh --- core/tabs/common-service-script.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 52967bca4..5828aa644 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -52,7 +52,6 @@ enableService() { "$ESCALATION_TOOL" rc-update add "$1" ;; runit) - "$ESCALATION_TOOL" mkdir -p "/run/runit/supervise.$1" "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" sleep 5 ;; From a669ed338f4dbe689dd19666d6f8fcca9cc5ba92 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:19:09 -0500 Subject: [PATCH 5/8] Update core/tabs/common-service-script.sh Cool with me. Thanks Co-authored-by: Adam Perkowski --- core/tabs/common-service-script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 5828aa644..ebe5be764 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -53,6 +53,7 @@ enableService() { ;; runit) "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" + printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}" sleep 5 ;; esac From 9c71edf06122561cf077b014271a988dfff978e6 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:25:40 -0500 Subject: [PATCH 6/8] Update core/tabs/common-service-script.sh Found it faster than me. Thanks Co-authored-by: Adam Perkowski --- core/tabs/common-service-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index ebe5be764..0020b064c 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -78,7 +78,7 @@ startAndEnableService() { systemctl) "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" ;; - rc-service|runit) + rc-service | runit) enableService "$1" startService "$1" ;; 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 7/8] 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 0020b064c..4e3e0ef04 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' From 9b3092687537af20e36d2256a93f008be4396d74 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:28:40 -0500 Subject: [PATCH 8/8] Update common-service-script.sh --- core/tabs/common-service-script.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh index 4e3e0ef04..281ccc699 100644 --- a/core/tabs/common-service-script.sh +++ b/core/tabs/common-service-script.sh @@ -53,6 +53,8 @@ enableService() { ;; sv) "$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/" + printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}" + sleep 5 ;; esac }