Merge 9b3092687537af20e36d2256a93f008be4396d74 into 6b572b1ab4de488f933c2c9fad280d2e9490f9d7

This commit is contained in:
Jaredy899 2025-02-12 01:23:46 +05:45 committed by GitHub
commit ec43665f3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,6 +23,9 @@ startService() {
rc-service) rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
;; ;;
sv)
"$ESCALATION_TOOL" sv start "$1"
;;
esac esac
} }
@ -34,6 +37,9 @@ stopService() {
rc-service) rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
;; ;;
sv)
"$ESCALATION_TOOL" sv stop "$1"
;;
esac esac
} }
@ -45,6 +51,11 @@ enableService() {
rc-service) rc-service)
"$ESCALATION_TOOL" rc-update add "$1" "$ESCALATION_TOOL" rc-update add "$1"
;; ;;
sv)
"$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/"
printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}"
sleep 5
;;
esac esac
} }
@ -56,6 +67,9 @@ disableService() {
rc-service) rc-service)
"$ESCALATION_TOOL" rc-update del "$1" "$ESCALATION_TOOL" rc-update del "$1"
;; ;;
sv)
"$ESCALATION_TOOL" rm -f "/var/service/$1"
;;
esac esac
} }
@ -64,7 +78,7 @@ startAndEnableService() {
systemctl) systemctl)
"$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1"
;; ;;
rc-service) rc-service | sv)
enableService "$1" enableService "$1"
startService "$1" startService "$1"
;; ;;
@ -79,7 +93,10 @@ isServiceActive() {
rc-service) rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
;; ;;
sv)
"$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1
;;
esac esac
} }
checkInitManager 'systemctl rc-service' checkInitManager 'systemctl rc-service sv'