diff --git a/readme-vars.yml b/readme-vars.yml index aa30ef40..7ebdef00 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -79,6 +79,7 @@ app_setup_block: | # changelog changelogs: + - { date: "09.07.21:", desc: "Wait for the transmission-daemon termination after a caught sigterm" } - { date: "06.03.21:", desc: "Add Flood for Transmission as a UI option" } - { date: "23.01.21:", desc: "Rebasing to alpine 3.13." } - { date: "02.11.20:", desc: "Add ca-certificates package to allow connecting to https trackers." } diff --git a/root/etc/services.d/transmission/run b/root/etc/services.d/transmission/run index a763936c..b8c49345 100644 --- a/root/etc/services.d/transmission/run +++ b/root/etc/services.d/transmission/run @@ -2,11 +2,15 @@ _term() { echo "Caught SIGTERM signal!" + echo "Tell the transmission session to shut down." + pid=$(pidof transmission-daemon) if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then /usr/bin/transmission-remote -n "$USER":"$PASS" --exit else /usr/bin/transmission-remote --exit fi + # terminate when the transmission-daemon process dies + tail --pid=${pid} -f /dev/null } trap _term SIGTERM