saltyorg / Saltbox

Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
https://docs.saltbox.dev
GNU General Public License v3.0
573 stars 65 forks source link

rutorrent: New image. #35

Closed saltydk closed 2 years ago

saltydk commented 2 years ago

Migrate rutorrent image to https://github.com/crazy-max/docker-rtorrent-rutorrent instead of the currently used one (horjulf/rutorrent-autodl).

saltydk commented 2 years ago

No longer convinced that this is the right image.

Download paths are hard-coded out of the box in the crazy-max image and container does not shut down gracefully which means it won't close until docker sends SIGKILL, which seems sub-optimal to me.

doob187 commented 2 years ago

@saltydk

Build on top

Dockerfile


ARG VERSION
FROM ghcr.io/crazy-max/rtorrent-rutorrent:${VERSION}

COPY ./root/04-overwrite.sh /etc/cont-init.d/04-overwrite.sh
RUN chmod a+x /etc/cont-init.d/04-overwrite.sh && mv /etc/cont-init.d/04-create-services.sh /etc/cont-init.d/05-create-services.sh

VOLUME [ "/data" ]
ENTRYPOINT [ "/init" ]

HEALTHCHECK --interval=30s --timeout=20s --start-period=10s \
CMD /usr/local/bin/healthcheck

#!/usr/bin/with-contenv sh
RU_DOWNLOAD_FOLDER=${RU_DOWNLOAD_FOLDER:-/downloads}
# Custom Folder
if [[ "${RU_DOWNLOAD_FOLDER}" != "/downloads" ]]; then
   rm -rf /downloads/{complete,temp}
   mkdir -p ${RU_DOWNLOAD_FOLDER} \
    ${RU_DOWNLOAD_FOLDER}/complete \
    ${RU_DOWNLOAD_FOLDER}/temp

   echo "  Enabling Custom Download Folder for rTorrent..."
   sed -i "s#/downloads#${RU_DOWNLOAD_FOLDER}#g" /etc/rtorrent/.rtlocal.rc
   echo "... Fixing perms for Custom Folders ..."
   chown rtorrent. \
    ${RU_DOWNLOAD_FOLDER} \
    ${RU_DOWNLOAD_FOLDER}/complete \
    ${RU_DOWNLOAD_FOLDER}/temp
fii
saltydk commented 2 years ago

The config issue is relatively easy to solve but the sigterm is likely more annoying to resolve outside of recreating the image entirely.

doob187 commented 2 years ago

We didn't have this problem With SIGKILL

I can stop and and start without hard to kill the docker

Could be a differenc between ansible and composer again

saltydk commented 2 years ago

Just run time docker stop rutorrent -t 60 and it'll take 60 seconds to exit.

doob187 commented 2 years ago

Ya with -t but docker-compose stop rutorrent stop then with SIGKILL

saltydk commented 2 years ago

I suspect your compose setup takes exactly 10 seconds to stop it. Which is the default timeout.

doob187 commented 2 years ago

Maybe 15 max . It was just an idea .. since I read them

So I share my logic to overwrite them ..

I found it useful for you maybe 😉

saltydk commented 2 years ago

Thanks for the attempt but the sigterm problem is big enough that I don't want to deal with it. Suspect qbittorrent will supersede rutorrent instead and might just move rutorrent to our community sandbox.

Maintaining container images that I do not personally run is not a good recipe for success imho.