Fix program did not exit cleanly

When running `docker compose down`, docker sends SIGTERM to tini and tini sends it to all child
programs (`entrypoint.sh` and therefore qbt-nox and its child programs). However `entrypoint.sh`
exits quite quickly and qbt was still cleaning up but tini detects that its first child process
(`entrypoint.sh`) is exited so itself exits too and leading to docker shutting down the
container abruptly.
Now qbt-nox is being placed as the first child process of tini.

Thanks to @thrnz for providing a fix.
Fixes #9.
This commit is contained in:
Chocobo1 2023-05-24 18:33:52 +08:00
parent 9708c583fa
commit a27e526829
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
2 changed files with 12 additions and 10 deletions

View File

@ -58,8 +58,9 @@ if [ -n "$UMASK" ]; then
umask "$UMASK"
fi
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"
exec \
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"

View File

@ -58,8 +58,9 @@ if [ -n "$UMASK" ]; then
umask "$UMASK"
fi
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"
exec \
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"