1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-21 23:33:18 +00:00

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 <micha@dietpi.com>
This commit is contained in:
MichaIng 2022-12-30 09:17:37 +01:00 committed by GitHub
parent 3a0403958a
commit de6effabb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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