Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Added a process running check #161

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Added a process running check #161

wants to merge 10 commits into from

Conversation

tenseiken
Copy link

@tenseiken tenseiken commented Feb 28, 2023

Starting with qbittorrent 4.5.0, I've been having a recurring problem where the process runs for a few days at most, then dies. The container keeps on running, so I have to catch it myself and manually restart the container. For my own sanity, I added a check in the network health check loop that determines if the process is running, and if not, uses the init file to start it back up again. Some relevant logging:

2023-02-28 15:17:39.268023 [INFO] Starting qBittorrent daemon...
Logging to /config/qBittorrent/data/logs/qbittorrent.log.
2023-02-28 15:17:40.312410 [INFO] Started qBittorrent daemon successfully...
2023-02-28 15:17:40.341013 [INFO] qBittorrent PID: 286
2023-02-28 15:17:40.371293 [INFO] HEALTH_CHECK_INTERVAL is not set. For now using default interval of 300
2023-02-28 15:17:40.399164 [INFO] RESTART_CONTAINER defined as 'yes'
2023-02-28 15:17:40.426182 [INFO] HEALTH_CHECK_AMOUNT is set to 10
2023-02-28 15:17:49.554854 [INFO] Network is up
2023-02-28 15:22:49.612724 [ERROR] qBittorrent daemon is not running. Restarting...
Logging to /config/qBittorrent/data/logs/qbittorrent.log.
2023-02-28 15:22:50.654853 [INFO] Started qBittorrent daemon successfully...
2023-02-28 15:22:59.795930 [INFO] Network is up

tenseiken and others added 10 commits February 28, 2023 17:06
Validates that the qbittorrent process is running during the health check loop. If it's not running, start it back up.
Leaving curl installed.
When leaving the ENABLE_SSL variable unset or set to something other than yes/no, true/false, 1/0, uses ignore mode, which makes no changes to qBittorrent.conf file for SSL. This is useful for when you are managing certificates manually.
Added SSL ignore mode functionality to the readme.
Disabling the find/chown line because it slows down start up considerably for me and isn't needed.
Dockerfile: Now downloads and extracts VueTorrent for optional use; leaves jq and natpmpc installed for port forwarding.

README.md: Updated the features listing to include the qBittorrent PID watch, VueTorrent, and Proton VPN port forwarding; updated the sample docker run command to use tenseiken/qbittorrentvpn instead of dyonr/qbittorrentvpn; added info about new environment variables.

qbittorrent/iptables.sh: Now calls new script file portfwd.sh to run indefinitely in the background.

qbittorrent/portfwd.sh: New script that keeps a working Proton VPN port forward set up within the container.

qbittorrent/start.sh: Added a section within the health check loop that ensures the listen port in qBittorrent matches up with the port being forwarded. It can change.
Added a line to log back out of the web UI API after each login. Prevents a bunch of orphaned login cookies from being valid longer than they need to be.
Redirecting output to /dev/null to suppress occasional error messages from curl.
Still getting errors from curl about the API login cookie being unset, so I've added some error handling around that.
Adding instructions for the Proton VPN port forward functionality.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant