guillaumedsde / alpine-qbittorrent-openvpn

qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
https://guillaumedsde.gitlab.io/alpine-qbittorrent-openvpn/
GNU General Public License v3.0
216 stars 40 forks source link

external program creates zombies #53

Open gmillerd opened 3 years ago

gmillerd commented 3 years ago

Information

Run external program on torrent completion is extremely fragile (static compile?) and crashes qbittorrent.

Current setup

information about your current setup

python 8eeac62e227d

docker-compose.yml file or docker run command

how did you start the container? (don't forget to use backticks for creating a proper code block)


docker run \
       --name "bt" \
       --rm \
       --cap-add=NET_ADMIN \
       -v /bt/xfers:/downloads \
       -v /bt/config:/config \
       -v /etc/localtime:/etc/localtime:ro \
       -e OPENVPN_PROVIDER= \
       -e OPENVPN_CONFIG=default \
       -e OPENVPN_USERNAME="REDACTED" \
       -e OPENVPN_PASSWORD="REDACTED" \
       -e PUID=1000 \
       -e PGID=1000 \
       -e LAN=192.168.0.0/24 \
       -p 8080:8080 \
       $IMG

Attempted Fix(es)

The following script works 1 or 2 times in 10, otherwise it creates defunct qbittorrent-nox processes. Where the process is stalled, killing the younger qbittorent-nox child processes frees up cleanly and qbittorrrent is back via systemctl.

Even a simple script with "date >> /config/log" for content zombies most of the time.

#/bin/sh

# /config/complete.sh "%I" "%R"

set -x

WEBUI="http://localhost:8080/api/v2/torrents"
HASH="$1"
RDIR="$2"

if [ "${HASH}" == "" ]; then exit; fi
if [ "$RDIR" == "" ]; then exit; fi
test ! -e "${RDIR}" && exit

function dl {
    curl --cookie 'SID=REDACTED' "${WEBUI}/$1"
}

if [ -n "${HASH}" ]; then
    dl "resume?hashes=$HASH"
    dl "removeTags?hashes=$HASH"
fi

if [ -n "${HASH}" ]; then
    dl "addTags?tags=syncing&hashes=$HASH"
fi

#
guillaumedsde commented 3 years ago

I've tried building an image with the official qbittorrent-nox build from the alpine linux repositories instead of my statically compiled binary, its tagged fix-use-alpine-repos-qbittorrent could you pull that image and let me know if the issue is fixed for you?