From de6effabb2484d30e55bbc39f9aadc64db9fc3a2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 30 Dec 2022 09:17:37 +0100 Subject: [PATCH] launcher: do not mask Jackett exit code (#13815) Currently, in the launcher script the whoami and updater loop are masking the exit code of Jackett. So even if Jackett errors out, the systemd service sees an exit code of "0", which e.g. breaks the `Restart=on-failure` in the [non-mono service template](https://github.com/Jackett/Jackett/wiki/Systemd-service#not-using-mono). This commit stores the exit code of Jackett in a variable and exits the script explicitly with this exit code, after the updater has been waited for. This way `Restart=on-failure` again can apply and `systemctl status jackett` reports the correct status if Jackett failed. Signed-off-by: MichaIng --- jackett_launcher.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jackett_launcher.sh b/jackett_launcher.sh index 12882a146..6202e9385 100755 --- a/jackett_launcher.sh +++ b/jackett_launcher.sh @@ -8,6 +8,7 @@ JACKETT_DIR="$(dirname "$(readlink -f "$0")")" # Launch Jackett (with CLI parameters) "${JACKETT_DIR}/jackett" --NoRestart "$@" +ec=$? # Get user running the service JACKETT_USER=$(whoami) @@ -16,3 +17,5 @@ JACKETT_USER=$(whoami) while pgrep -u "${JACKETT_USER}" JackettUpdater > /dev/null; do sleep 1 done + +exit $ec