rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.08k stars 409 forks source link

rTorrent service not working but no errors. #975

Open IzaacJ opened 4 years ago

IzaacJ commented 4 years ago

I'm setting up a headless torrent server using rTorrent and Flood UI.

Host: Proxmox VE 6.0 OS: TurnKey Linux - Debian 9 LXC Container rTorrent version: rTorrent 0.9.6/0.13.6

Any ideas what could be wrong? Been messing with this for the last week or so.

These are the steps I take to install rTorrent:

apt-get install -y tmux rtorrent libtorrent19 libxmlrpc-core-c3 unrar
adduser --system --disabled-password --gecos "" --home /storage/rtorrent rtorrent
mkdir -p /storage/active
mkdir -p /storage/finished
mkdir -p /storage/rtorrent/{session,watch}
chmod 777 -R /storage/active
chmod 777 -R /storage/finished
chmod 777 -R /storage/rtorrent
chown rtorrent:rtorrent -R /storage/rtorrent
chown rtorrent:rtorrent -R /storage/active
chown rtorrent:rtorrent -R /storage/finished
systemctl enable rtorrent.service
service rtorrent start

rtorrent.service:

[Unit]
Description=rTorrent
[Service]
Type=oneshot
RemainAfterExit=yes
User=rtorrent
ExecStartPre=-/bin/rm -f /storage/rtorrent/session/torrent.lock
ExecStart=/usr/bin/tmux -2 new-session -d -s rtorrent "rtorrent -o import=/storage/rtorrent/.rtorrent.rc"
ExecStop=/usr/bin/tmux kill-session -t rtorrent
[Install]
WantedBy=multi-user.target

.rtorrent.rc:

method.insert = cfg.basedir, private|const|string, (cat, "/storage/rtorrent/")
method.insert = cfg.download, private|const|string, (cat, "/storage/active/")
method.insert = cfg.logs, private|const|string, (cat, (cfg.basedir),"log/")
method.insert = cfg.logfile, private|const|string, (cat, (cfg.logs),"rt-",(system.time),".log")
method.insert = cfg.session, private|const|string, (cat, (cfg.basedir),"session/")
method.insert = cfg.watch, private|const|string, (cat, (cfg.basedir),"watch/")
execute.throw = sh, -c, (cat, \
    "mkdir -p \"",(cfg.download),"\" ", \
    "\"",(cfg.logs),"\" ", \
    "\"",(cfg.session),"\" ", \
    "\"",(cfg.watch),"/load\" ", \
    "\"",(cfg.watch),"/start\" ")
network.port_range.set = 50000-50000
network.port_random.set = no
dht.mode.set = disable
protocol.pex.set = no
trackers.use_udp.set = no
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 25
throttle.min_peers.normal.set = 20
throttle.max_peers.normal.set = 60
throttle.min_peers.seed.set = 30
throttle.max_peers.seed.set = 80
trackers.numwant.set = 80
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry
network.http.max_open.set = 50
network.max_open_files.set = 600
network.max_open_sockets.set = 300
pieces.memory.max.set = 1800M
network.xmlrpc.size_limit.set = 4M
session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download))
log.execute = (cat, (cfg.logs), "execute.log")
log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log")
execute.nothrow = sh, -c, (cat, "echo >",(session.path),"rtorrent.pid"," ",(system.pid))
encoding.add = utf8
system.umask.set = 0027
system.cwd.set = (directory.default)
network.http.dns_cache_timeout.set = 25
schedule2 = monitor_diskspace,15,60,((close_low_diskspace,1000M))
pieces.hash.on_completion.set = no
view.sort_current = seeding,greater=d.ratio=
keys.layout.set = qwerty
method.insert = system.startup_time,value|const,(system.time)
method.insert = d.data_path,simple, \
   "if=(d.is_multi_file),\
      (cat, (d.directory), /),\
      (cat, (d.directory), /, (d.name))"
method.insert = d.session_file, simple, "cat=(session.path), (d.hash), .torrent"
schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent")))
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/.torrent")))
#system.daemon.set = true
network.scgi.open_local = (cat,(session.path),rpc.socket)
execute.nothrow = chmod,770,(cat,(session.path),rpc.socket)
print = (cat, "Logging to ",(cfg.logfile))
log.open_file = "log",(cfg.logfile)
log.add_output = "info","log"

service rtorrent status:

rtorrent.service - rTorrent
   Loaded: loaded (/etc/systemd/system/rtorrent.service; enabled; vendor preset: enabled)
   Active: active (exited) since Tue 2020-03-17 20:46:27 UTC; 14min ago
  Process: 10456 ExecStart=/usr/bin/tmux -2 new-session -d -s rtorrent rtorrent -o import=/storage/rtorrent/.rtorrent.rc (code=exited, status=0/SUCCESS)
  Process: 10455 ExecStartPre=/bin/rm -f /storage/rtorrent/session/torrent.lock (code=exited, status=0/SUCCESS)
 Main PID: 10456 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/rtorrent.service

Mar 17 20:46:27 torrent systemd[1]: rtorrent.service: Failed to reset devices.list: Operation not permitted
Mar 17 20:46:27 torrent systemd[1]: Starting rTorrent...
Mar 17 20:46:27 torrent systemd[1]: Started rTorrent.

journalctl -xe:

Mar 17 20:46:27 torrent systemd[1]: rtorrent.service: Failed to reset devices.list: Operation not permitted
Mar 17 20:46:27 torrent systemd[1]: Starting rTorrent...
-- Subject: Unit rtorrent.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit rtorrent.service has begun starting up.
Mar 17 20:46:27 torrent systemd[1]: Started rTorrent.
-- Subject: Unit rtorrent.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit rtorrent.service has finished starting up.
-- 
-- The start-up result is done.
pyroscope commented 4 years ago

Sure there are errors – in the tmux session you did not keep open to see them.

TMTYD commented 4 years ago

do you have the right rights for the log directory?