Can't run rtorrent as a service

1. I installed termux-services and rtorrent, then restarted termux. 2. Created a folder mkdir -p $PREFIX/var/service/rtorrent/log 3. Created a "run" script inside $PREFIX/var/service/rtorrent with the following code
#!/data/data/com.termux/files/usr/bin/bash
exec rtorrent
#!/data/data/com.termux/files/usr/bin/bash
exec rtorrent
4. Made the script executable with chmod +x run 5. Added a symbolic link ln -sf $PREFIX/share/termux-services/svlogger $PREFIX/var/service/rtorrent/log/run 6. sv start rtorrent and sv-enable rtorrent don't work. The above workflow works witt other apps like iperf3? How can I solve it and run rtorrent as a service?
12 Replies
Cuteness
Cuteness2mo ago
Have you tried to run rtorrent directly to see if it is even able to run without an error?
Magischian
MagischianOP2mo ago
Yes, it rus without an error. I had to create som sort of a tmux + rtorrent srcipt and check it with a cron job every minute
Cuteness
Cuteness2mo ago
You never said it was actually running successfully...
Magischian
MagischianOP2mo ago
Sorry for not clarifying it, rtorrent works when executed manually with rtorrent, however when I try to run it as a service, it doesn't work.
Cuteness
Cuteness2mo ago
Also are you 100% certain your config is not telling it to "quit after done seeding" / etc.?
Magischian
MagischianOP2mo ago
I haven't add anythin, about seeding, launching it from the command line keeps it running even when no torrent is being actively seeded
Cuteness
Cuteness2mo ago
Plus, are you passing in the flag via. the service thing to make sure it knows to run as a daemon / service? Some programs have a command line argument which makes it know about this. An example program (I cannot think of the name right now) has it named --daemon or -d
Magischian
MagischianOP2mo ago
I just googled it, it seems that I'll need to add a setting system.daemon.set = true I'll experiment with and see what happens.
Cuteness
Cuteness2mo ago
Yeah, that's probably it. I assume the program allows you to specify a specific config file on the command line? ^ @Magischian
Magischian
MagischianOP2mo ago
I'll check You can add -o key=value to the rtorrent command
Cuteness
Cuteness2mo ago
That should probably work.
-o 'system.daemon.set=true'
-o 'system.daemon.set=true'
Of course, use whatever shell's quoting style where necessary, such as if = is a special character.
Magischian
MagischianOP2mo ago
exec rtorrent -o system.daemon.set=true
exec rtorrent -o system.daemon.set=true
This made it work as a daemon. Thanks for your help.

Did you find this page helpful?