this post was submitted on 01 Mar 2025
0 points (50.0% liked)

Self Hosted - Self-hosting your services.

12490 readers
1 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS
 

On my truenas scale machine, I have a container for gluetun and one for qbittorrent (among others). Maybe a couple times a week, I notice that the VPN connection gets flakey. Qbittorrent speeds go down into the kb/s range. This promps me to carry out an annoying, manual process:

  1. I pause all torrents in qbittorrent webui
  2. I stop both the qbit and gluetun containers
  3. I start the gluetun container
  4. I give the gluetun container adequate time to connect (since the qbit container depends on the gluetun network, attempting to start both at the same time yields an error on the qbit side)
  5. I start the qbit container
  6. I resume all torrents in the qbittorrent webui

Is there any easy way to automate this process? Preferably one that doesn't require me to learn ansible? I'm hoping the solution could all be done via portainer - which I use.

Thank you in advance.

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 2 weeks ago (1 children)

Cronjob and a bash script?

[–] [email protected] 1 points 2 weeks ago (2 children)

You're thinking i could make a bash script that pauses all torrents and a cronjob that restarts containers with some timing built in?

[–] [email protected] 2 points 2 weeks ago

You could definitely do that. I use this to manage torrents from the command line and in scripts

[–] [email protected] 0 points 2 weeks ago

Yeah. Example: if pings get flakey, or can't curl address, then restart all the things.

Doesn't need to stop torrents, just close the app, restart networking, and start it again.

[–] [email protected] 2 points 2 weeks ago

I would investigate what is actually causing the connection to slow, but you can just run docker restart gluetun qbittorrent from cron or whatever.

[–] [email protected] 1 points 2 weeks ago

Make sure everything starts automatically after a reboot, and reboot daily.