Howto: RTorrent with Webinterface

Questions regarding modifying the torrent engine or download station may go here.
Forum rules
Please note the disclaimer before modifying your Synology Product.

Re: Howto: RTorrent with Webinterface

Postby >reSPAWNed< » Thu May 22, 2008 6:24 pm

Hi dimip,

What did you do to get rtorrent running?
You see, I have the exact same problem you had, and I can't seem to start rtorrent and all without any errors displaying and the log in "/root/rtorrentInit.log" is empty.

I have followed the guide very carefully, and I suspect that the problem might be in the "/opt/etc/init.d/S99rtorrent" file where I have written the following:
Code: Select all
  stty stop undef && stty start undef                       
  [ -d "${base}" ] && cd "${base}"             
  #su -c "screen -ls | grep -sq "\.${srnname}[[:space:]]" " ${user} || su -c "screen -dm -S ${srnname} 2>&1 1>/dev/null" ${user} | tee -a "$logfil
  # this works for the screen command, but starting rtorrent below adopts screen session gid
  # even if it is not the screen session we started (e.g. running under an undesirable gid                                                       
  #su -c "screen -ls | grep -sq "\.${srnname}[[:space:]]" " ${user} || su -c "sg \"$group\" -c \"screen -fn -dm -S ${srnname} 2>&1 1>/dev/null\""
  #su -c "screen -S "${srnname}" -X screen rtorrent ${options} 2>&1 1>/dev/null" ${user} | tee -a "$logfile" >&2
  su -c "screen -d -m rtorrent ${options} 2>&1 1>/dev/null" ${user} | tee -a "$logfile"

But then again, I am not at all certain, since I have little experience in linux compared to the gurus in here... :wink:

The essence is, that when I navigate to "http://diskstation:8081/lighttpd/wtorrent/", it says "Error: could not connect to rtorrent".
Which is obvious since I can't find rtorrent on the list of running processes.

[EDIT]
I finally got it... The problem was that I started rtorrent from "/opt/etc/init.d/S99rtorrent", which didnt' display an error.
But then when I tried to start it with just "rtorrent", it suddenly gave me the answer
Code: Select all
DiskStation> rtorrent
rtorrent: error while loading shared libraries: libtorrent.so.9: cannot open shared object file: No such file or directory

The libtorrent library was outdated, so I installed the new one from "optware" and suddenly I could start my precious rtorrent... :D
[/EDIT]
>reSPAWNed<
I'm New!
I'm New!
 
Posts: 5
Joined: Mon May 19, 2008 9:06 am

Re: Howto: RTorrent with Webinterface

Postby >reSPAWNed< » Fri May 23, 2008 9:11 pm

Hi again everybody, I was a little too quick to celebrate my victory... :?

First of I have to say, that I had to downgrade rtorrent and libtorrent, since the tracker I am using has a very strict policy, which means that only stable and reliable verisons of all clients are allowed.
I had to uninstall and then install the two packages (which I got from the original source: http://www.maartendamen.com/synoware).

It all seemed to work, so I started a download to test it all... Next day it still had no problem, so I added two more torrents, and now I have one completed torrent and two torrents that both report "Storage error: [File chunk write error: Cannot allocate memory.]"

I googled around and found that you could add an option called "max_memory_usage", which could solve the problem. But no matter how high I set it, it keep giving me the same error...

My question is of course how to fix this problem, and if this option is really the solution.

My current versions are:
libtorrent - 0.11.9-1
rtorrent - 0.7.9-2
>reSPAWNed<
I'm New!
I'm New!
 
Posts: 5
Joined: Mon May 19, 2008 9:06 am

Re: Howto: RTorrent with Webinterface

Postby dimip » Sat May 24, 2008 2:18 am

dimip wrote:finally it worked too much trouble and now from the only tracker i download i get this error '' could not parse bencoded it data and low disk space and i have more than 400gb free space
Image



for some reason it saves the data in root rtorrent/session and thats why low disk space? how do i fix this please?
dimip
Beginner
Beginner
 
Posts: 25
Joined: Fri Feb 22, 2008 12:22 am

Re: Howto: RTorrent with Webinterface

Postby siliconix » Sat May 24, 2008 5:45 am

>reSPAWNed< wrote:Hi again everybody, I was a little too quick to celebrate my victory... :?

First of I have to say, that I had to downgrade rtorrent and libtorrent, since the tracker I am using has a very strict policy, which means that only stable and reliable verisons of all clients are allowed.
I had to uninstall and then install the two packages (which I got from the original source: http://www.maartendamen.com/synoware).

It all seemed to work, so I started a download to test it all... Next day it still had no problem, so I added two more torrents, and now I have one completed torrent and two torrents that both report "Storage error: [File chunk write error: Cannot allocate memory.]"

I googled around and found that you could add an option called "max_memory_usage", which could solve the problem. But no matter how high I set it, it keep giving me the same error...

My question is of course how to fix this problem, and if this option is really the solution.

My current versions are:
libtorrent - 0.11.9-1
rtorrent - 0.7.9-2


If you use versions this old, with xmlrpc, you WILL suffer from the rtorrent memory leaks. When I used it earlier with 0.8.0, I had a cron job to restart rtorrent daily cause of that. One thing that will "accellerate" the issue is having jumbo frames enabled. I tried a lot of different settings to work around it, but never found anything that worked fully, but yeah, disable jumboframes, dont grab insanely large torrents, restart rtorrent regularly and maybe stop some unneeded services. But the problem will go away mostly with rtorrent 0.8.2, but doesn't help you much until your tracker accepts a never one.
Do the tracker actually prevent you from using it, or is it just in their rules that you shouldnt ?
siliconix
I'm New!
I'm New!
 
Posts: 9
Joined: Mon May 19, 2008 1:34 pm

Re: Howto: RTorrent with Webinterface

Postby >reSPAWNed< » Sat May 24, 2008 9:52 pm

Hi siliconix

First of all thank you very much for sharing your knowlegde.

I have to use one of their approved clients, or else the torrent will not start and is giving an error, saying that the client is banned from the tracker.

It sounds exausting to use this version, is it perhaps possible to install another client, for instance I have seen Transmission on the list of packages available.
Which other decent torrent clients can I install on a DS 207+?
>reSPAWNed<
I'm New!
I'm New!
 
Posts: 5
Joined: Mon May 19, 2008 9:06 am

Re: Howto: RTorrent with Webinterface

Postby siliconix » Mon May 26, 2008 8:02 am

>reSPAWNed< wrote:Hi siliconix

First of all thank you very much for sharing your knowlegde.

I have to use one of their approved clients, or else the torrent will not start and is giving an error, saying that the client is banned from the tracker.

It sounds exausting to use this version, is it perhaps possible to install another client, for instance I have seen Transmission on the list of packages available.
Which other decent torrent clients can I install on a DS 207+?


Apparently transmission works for some people, I didnt have much luck with it on Qnap at least, lots of segmentation faults. But give it a shot, or try to "bribe" the admins on the tracker to allow rtorrent 0.8.2
siliconix
I'm New!
I'm New!
 
Posts: 9
Joined: Mon May 19, 2008 1:34 pm

Re: Howto: RTorrent with Webinterface

Postby Lapin » Mon May 26, 2008 10:24 pm

Tha_Duck wrote:Thanks for this info, it is working (almost) great!

One little question, after my downloads are finished the file rights on the downloaded folders/files in my /volume1/download folder are like this:
drwxr-xr-x 2 root root 4096 May 10 23:25 B***
drwxr-xr-x 2 root root 4096 May 10 23:24 B2***

With this rights I cannot remove/move the folders/files. Is there a way the folders/files just be all rwx instead of user only?


Maybe a solution, I have not tested it.
Under wTorrent admin interface, create a new "torrent" user, according to your declared user (access right of your Syno).
Then use this user to login and download torrent under wTorrent.

Keep me in touch.

PS: Sorry for my late answer, but I was in vacation last week :)
Synology Model: DS-411+
Firmware Version: 4.1-2668
HDD Model: 4xSeagate ST2000DL003 2To - SHR
User avatar
Lapin
Versed
Versed
 
Posts: 264
Joined: Thu May 08, 2008 12:18 am
Location: Caen, France

Re: Howto: RTorrent with Webinterface

Postby >reSPAWNed< » Tue May 27, 2008 10:17 am

I tried to "bribe" one of the admins at my tracker, but the immediate answer was no, since the new version is not yet "stable", whatever that implies...

Thanks for the reply Lapin, but for some reason rTorrent seems to work now, however it does not create the socket, so wTorrent cannot connect to it.

I'm happy that the bittorrent client is working, but it would be nice to have the interface too. Do any of you know if the socket-way of connecting the two programs is also available in rTorrent 0.7.9?
>reSPAWNed<
I'm New!
I'm New!
 
Posts: 5
Joined: Mon May 19, 2008 9:06 am

Re: Howto: RTorrent with Webinterface

Postby pableu » Wed May 28, 2008 8:34 am

>reSPAWNed< wrote:Do any of you know if the socket-way of connecting the two programs is also available in rTorrent 0.7.9?
You could try scgi_port instead of scgi_local, maybe that works. Of course you'll have to edit the lighttpd.conf accordingly.
pableu
Sharp
Sharp
 
Posts: 162
Joined: Wed May 09, 2007 9:33 pm

Re: Howto: RTorrent with Webinterface

Postby windar » Wed May 28, 2008 12:48 pm

Thanks for that great HowTo !

Installed the whole thing on my unmodded DS107+ last night, works perfectly :-)

--
Jungle Power !
Jungle Power !
User avatar
windar
Student
Student
 
Posts: 67
Joined: Wed May 28, 2008 12:35 pm

Re: Howto: RTorrent with Webinterface

Postby Tha_Duck » Wed May 28, 2008 3:47 pm

I have 'fixed' the rights problem. I now run every 15 minutes a chmod a+rwx from the crontab. Good enough for me :)
Tha_Duck
I'm New!
I'm New!
 
Posts: 4
Joined: Wed May 14, 2008 6:11 pm

Re: Howto: RTorrent with Webinterface

Postby windar » Thu May 29, 2008 12:18 pm

Tha_Duck wrote:I have 'fixed' the rights problem. I now run every 15 minutes a chmod a+rwx from the crontab. Good enough for me :)


Could the umask setting in the .profile of root folder be any help regarding this issue ?
Jungle Power !
User avatar
windar
Student
Student
 
Posts: 67
Joined: Wed May 28, 2008 12:35 pm

Re: Howto: RTorrent with Webinterface

Postby pableu » Sat May 31, 2008 11:09 am

I created a small php-script that can start/stop rtorrent as needed from the webinterface. It uses lapins start/stop script. You can copy it to somewhere like /opt/share/www/lighttpd/starter.php and use it using start.php?action=start or start.php?action=stop to start/stop rtorrent. Maybe some more consideration wheter rtorrent should be run as root ro not should be done ;-)
Code: Select all
<?php
$rtorrent = "/opt/etc/init.d/S99rtorrent"
if ($_GET['action']=='start'){
        echo exec("$rtorrent start");
        echo "Started";
}
elseif ($_GET['action']=='stop'){
        echo exec("$rtorrent stop");
        echo "Stopped";
}
?>


Furthermore, one can just add a line "umask 000" to the beginning of lapins script to have all files by rtorrent created using rw-rw-rw, so that there shouldn't be any more problems deleting files from the share.
pableu
Sharp
Sharp
 
Posts: 162
Joined: Wed May 09, 2007 9:33 pm

Re: Howto: RTorrent with Webinterface

Postby windar » Sat May 31, 2008 11:56 am

Indeed, "umask 000" at beginning of S99rtorrent does just the trick :-)
Jungle Power !
User avatar
windar
Student
Student
 
Posts: 67
Joined: Wed May 28, 2008 12:35 pm

Re: Howto: RTorrent with Webinterface

Postby Lapin » Sat May 31, 2008 8:02 pm

Hi folks,

I tried the latest beta firmware (more info here). This version included a proper torrent with seeding settings. It is working perfectly, even on private trackers. Synology used rtorrent version 0.8.0. Don't forget to also install the latest version of Download Redirector.
Synology Model: DS-411+
Firmware Version: 4.1-2668
HDD Model: 4xSeagate ST2000DL003 2To - SHR
User avatar
Lapin
Versed
Versed
 
Posts: 264
Joined: Thu May 08, 2008 12:18 am
Location: Caen, France

PreviousNext

Return to Torrent Engines/Download Station Mods

Who is online

Users browsing this forum: No registered users and 1 guest