xombiemp / ultimate-torrent-setup

All the files needed for the Ultimate Torrent Setup, featuring Ubuntu, rtorrent, ruTorrent, Sonarr, Radarr.
232 stars 44 forks source link

rtorrent systemd service is not starting #27

Closed crsantos closed 8 years ago

crsantos commented 8 years ago

Not really sure if this is a bad config but my systemd's rtorrent.service is not starting.

My config has the same ExecStart:

ExecStart=/usr/bin/rtorrent -n -o import=/var/lib/rtorrent/rtorrent.rc

rtorrent used to require an interactive session, don't know if now it runs as a daemon... That's what I found weird. How can you run it without screen or tmux?

On the process of debugging I found this error: Error opening terminal: unknown. but quickly found out that the export TERM was missing, so I add it to the rtorrent.service file: Environment=TERM=xterm.

Now, with the proper term set, I get this output from journalctl:

nuc rtorrent[2188]: [187B blob data]
nuc rtorrent[2188]: /usr/lib/x86_64-linux-gnu/libtorrent.so.19(_ZN7torrent14internal_error10initializeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x227)
nuc rtorrent[2188]: /usr/lib/x86_64-linux-gnu/libtorrent.so.19(_ZN7torrent14internal_errorC1EPKc+0xb8) [0x7f578fe3f868]
nuc rtorrent[2188]: /usr/lib/x86_64-linux-gnu/libtorrent.so.19(_ZN7torrent9PollEPoll6modifyEPNS_5EventEij+0x18c) [0x7f578fe593cc]
nuc rtorrent[2188]: /usr/bin/rtorrent() [0x44da22]
nuc rtorrent[2188]: /usr/bin/rtorrent() [0x411fdf]
nuc rtorrent[2188]: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f578e991830]
nuc rtorrent[2188]: /usr/bin/rtorrent() [0x415329]
nuc systemd[1]: rtorrent.service: Main process exited, code=exited, status=255/n/a
nuc systemd[1]: rtorrent.service: Unit entered failed state.
nuc systemd[1]: rtorrent.service: Failed with result 'exit-code'.
nuc systemd[1]: rtorrent.service: Service hold-off time over, scheduling restart.
nuc systemd[1]: Stopped rTorrent.
-- Subject: Unit rtorrent.service has finished shutting down

I can't find a reason for rtorrent to die like this unless is the requirement of an interactive session. Did anyone suffer from something like this?

xombiemp commented 8 years ago

Are you compiling rtorrent from the latest source? Here is the commit that allows rtorrent to run as a daemon (without screen or tmux). https://github.com/rakshasa/rtorrent/commit/5a56fbd5d15c8e3fa64df54111c2265c5a3da103

Do you have this in your rtorrent.rc?: system.daemon.set = true

crsantos commented 8 years ago

OMG, so that makes sense... I opted for the only apt available version but I guess system.daemon.set = true is only available on the latest one. So I guess I removed that line. I completely forgot that I removed that line.

Many thanks @xombiemp 🎉