1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-27 02:09:24 +00:00
Jackett/jackett_launcher.sh
MichaIng de6effabb2
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>
2022-12-30 08:17:37 +00:00

21 lines
448 B
Bash
Executable file

#!/bin/sh
# Helper script to fix
# https://github.com/Jackett/Jackett/issues/5208#issuecomment-547565515
# Get full Jackett root path
JACKETT_DIR="$(dirname "$(readlink -f "$0")")"
# Launch Jackett (with CLI parameters)
"${JACKETT_DIR}/jackett" --NoRestart "$@"
ec=$?
# Get user running the service
JACKETT_USER=$(whoami)
# Wait until the updater ends
while pgrep -u "${JACKETT_USER}" JackettUpdater > /dev/null; do
sleep 1
done
exit $ec