mirror of
https://github.com/Jackett/Jackett
synced 2024-12-23 00:08:23 +00:00
de6effabb2
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>
21 lines
448 B
Bash
Executable file
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
|