Run rtorrent in a Docker container

Perhaps @joakim_s can help, I am no expert but would love to help growing the App Store.
Flood doesn’t use Apache or php only node.js so thats a bit easier I hope.

@sam_nazarko Flood is default pointed on a none standard port.

@zilexa i have no experience(yet) to build a package for OSMC store, and it might be even harder when you got to install package that’s not in the debian repository. The version of node in debian is to old for Flood.

@joakim_s

Thanks so much for your flood how to, I finally got it working on my Pi. Using npm start there are no issues, but I have tried to make a systemd service, and it appears to start correctly at first but eventually errors with

npm ERR! code ELIFECYCLE
npm ERR! flood@1.0.0 start: node server/bin/start.js

This is my flood.service

[Unit]
Description=Flood, web interface for rTorrent
After=network.target

[Service]
User=flood
ExecStart=/usr/bin/npm start --production /srv/torrent/flood
WorkingDirectory=/srv/torrent/flood
Restart=on-failure

[Install]
WantedBy=multi-user.target

I know this is very unrelated but you’re the only person on the internet that has written instructions for the Pi. Thanks!

I’ve solved it with another approach, i’ve used screen to detach the process of rtorrent and flood(which is installed in osmc-home folder).

flood.service:

[Unit]
Description = Floodserver
After = remote-fs.target network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
User=osmc
ExecStart = /home/osmc/scripts/floodstarter.sh
ExecStop = /home/osmc/scripts/floodstopper.sh
TimeoutStopSec=20

[Install]
WantedBy = multi-user.target

rtorrent.service

[Unit]
Description = Rtorrent
After = remote-fs.target network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
User=osmc
ExecStart = /home/osmc/scripts/rtorrentstarter.sh
ExecStop = /home/osmc/scripts/rtorrentstopper.sh
TimeoutStopSec=20

[Install]
WantedBy = multi-user.target

/home/osmc/scripts/floodstarter.sh

#!/bin/bash
screen -dmS flood /bin/bash
screen -S flood -X eval ‘stuff “cd /home/osmc/flood ^M”’
screen -S flood -X eval ‘stuff “sudo npm start ^M”’
exit

/home/osmc/scripts/floodstopper.sh

#!/bin/bash
screen -S flood -X eval ‘stuff ^C’
screen -S flood -X eval ‘stuff “exit ^M”’
exit

/home/osmc/scripts/rtorrentstarter.sh

#!/bin/bash
screen -dmS Rtorrent /usr/local/bin/rtorrent
exit

/home/osmc/scripts/rtorrentstopper.sh

#!/bin/bash
screen -S Rtorrent -X eval ‘stuff ^Q’
exit

I know this is not ideal, but that’s how I did it. Don’t remember why i sudo’d npm, think i had it running on port 80 from start.