rTorrent + ruTorrent guide

saroos1

Member
May 25, 2018
718
0
16
Just registered to say Thanks! First script I tried which worked without troubles. Used on a Raspberry Pi with Raspbian(September 2014) with settings: RTVERSION="0.9.3" and RUTORRENT_RPC="SCGI" .

Two things I encountered are this warning:
Code:
(22:46:56) The SCGI socket is bound to a specific network device yet may still pose a security risk, consider using 'scgi_local'.
Answer here: http://forums.rutorrent.org/index.php?topic=256.msg14355#msg14355

And the "rutracker_check: Plugin will not work." mentioned before but works after adding a torrent.

Now to find a way to startup rtorrent at boot (This one doesn't work: http://forums.rutorrent.org/index.php?topic=1442.0).
 

simur612

Member
May 25, 2018
879
0
16
Now to find a way to startup rtorrent at boot (This one doesn't work: http://forums.rutorrent.org/index.php?topic=1442.0).
You should read the documentation about init scripts of the distro you're using. Since you probably just want a simple script that works for your own comfort, you can ignore everything about LSB guidelines. Raspbian is based on Debian which uses SysVinit and the standard way to do init scripts is using /etc/init.d
Use an init script to start a detached session using a utility such as screen or tmux as rTorrent still doesn't support running as a daemon (first post of this threads has screen and tmux examples at the end)
Here is a simple example of an init script https://www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
 

peshua19

Member
May 25, 2018
897
0
16
hi.

i want create private space for my user- like this e.g:

how setup 50GB space for every user in seedbox? in muliuser mode.


i look this thread but i dont find sad.gif

thans admin.
 

lisas4567

Member
May 25, 2018
773
0
16
Hi.

Thanks for this script...it looks like it could save a hell of a lot of time...

...however :p

When I run it, it runs for some time and then eventually I get this:

Code:
bash: line 36: build_dep: command not found

Exiting with status code 127.

Clearly, there's a dependency that I have missing, but I don't know how to put it right.
 

saroos1

Member
May 25, 2018
718
0
16
Clearly, there's a dependency that I have missing, but I don't know how to put it right.
You seem to have a different problem: here-docs don't seem to work on your system. That seems very strange to me though and I have no idea how you got in that situation. Try to run this script as a test - run it as root and pass your username as an argument:
Code:
#!/bin/sh

echo start

su $1 << EOF
echo here-doc
EOF

echo done
 

simur612

Member
May 25, 2018
879
0
16
Hi, and wow...thanks for the quick reply!

I ran the script and here is the output:

Code:
start
here-doc
done

As a bit of background, in case it helps, the OS is Ubuntu Server 14.04.1 LTS - a fresh install yesterday on a Dell Poweredge R220.
 

lisas4567

Member
May 25, 2018
773
0
16
I ran the script and here is the output:
Seems here docs work fine on your system, are you sure you didn't accidentally modify the file? The code looks fine and I just tried running it on my system (the part which doesn't work for you) and it all works fine. Maybe try copy-pasting the code again just to make sure you have the right code?
(I think you have a typo at line 146 of the file, where it should say su $USER << "build_dep")
 

saroos1

Member
May 25, 2018
718
0
16
Hi again.

I copied and pasted again from the pastebin link. Firstly, I tried pasting into Notepad on Windows (yesterday I pasted directly into Joe (a vi clone)). It really didn't like that at all - all the line ends were cocked up, so I again pasted straight to the linux text editor through Putty - this it seemed to like....but I get the same error.

I checked line 146 and it says:

Code:
# Download and build rTorrent dependencies (as USER)
su $USER << "build_dep"


As as side note, some of the indentation appears to have been lost in the paste. I don't think this should matter to a shell script, but I could be wrong
 

simur612

Member
May 25, 2018
879
0
16
As as side note, some of the indentation appears to have been lost in the paste. I don't think this should matter to a shell script, but I could be wrong
Honestly, I have no idea why it doesn't wok for you. The only thing that I can think of is that for some reason there's a whitespace or something in front of build_dep on line 182 in your script. You could try the following though:
1. copy and paste the whole thing in windows notepad again
2. upload it to your rTorrent server
3. navigate to the folder where you saved the script and enter the following in terminal "dos2unix redtorrent.sh"
4. run the script "sudo sh redtorrent.sh <rtorrent-user>"
 

randac56

Member
May 25, 2018
915
0
16
You Sir...are a genius! Thank you so much!

It's working!

It does say:
Code:
[19.01.2015 09:25:05] WebUI started.
[19.01.2015 09:25:05] rutracker_check: Plugin will not work. Webserver user must have execute access to the rtorrent session directory ().
[19.01.2015 09:25:05] screenshots: Plugin will not work. rTorrent user can't access external program (ffmpeg).

...in the Log tab on the WebUi, but that doesn't seem to be affecting anything.
 

peshua19

Member
May 25, 2018
897
0
16
I am completely lost at what to do from here. I used the script and had zero errors. I restarted the apache webserver, and can start screen rtorrent no problem. How do I get into the webui? Is it the ip for the device (192.168.1.36) or the scgi ip 127.0.0.1? Is the port 5000? When I try 192.168.1.36/rutorrent I get a 404. How can I tell if rutorrent is actually running and not just rtorrent? Gah I'm so confused!
 

lisas4567

Member
May 25, 2018
773
0
16
I am completely lost at what to do from here. I used the script and had zero errors. I restarted the apache webserver, and can start screen rtorrent no problem. How do I get into the webui? Is it the ip for the device (192.168.1.36) or the scgi ip 127.0.0.1? Is the port 5000? When I try 192.168.1.36/rutorrent I get a 404. How can I tell if rutorrent is actually running and not just rtorrent? Gah I'm so confused!
192.168.1.36 looks like a local IP so I assume you installed it on a computer at your home? This means that whenever you are connected with a device to your own router/local network, you should be able to open the ruTorrent webUI by surfing to 192.168.1.36/rutorrent. Outside of your home/local network this will NOT work (you need to configure port forwarding on your router if you want to allow that)
To check if rTorrent is running, login to the server as the rtorrent user via remote terminal (eg Putty) and type "screen -list". If it tells you that there is a detached session named "rtorrent", rtorrent is running. Apache should be running automatically and ruTorrent is run by Apache so that should be ok (you can confirm that it is running by typing "sudo service apache2 status"). To check if ruTorrent is actually located in the correct dir, type "grep DocumentRoot /etc/apache2/sites-available/default". If the output tells you that it's located at "/var/www" for example, you should go to that dir with "cd /var/www" and check if rutorrent is located there (you can use "ls" to list the contents of a dir so typing "ls" while in the "/var/www" in this case, should include "rutorrent"
 

saroos1

Member
May 25, 2018
718
0
16
192.168.1.36 looks like a local IP so I assume you installed it on a computer at your home? This means that whenever you are connected with a device to your own router/local network, you should be able to open the ruTorrent webUI by surfing to 192.168.1.36/rutorrent. Outside of your home/local network this will NOT work (you need to configure port forwarding on your router if you want to allow that)
Correct, i'm attempting to ssh in with putty from my windows desktop machine, and then from the same windows machine access the webui.
To check if rTorrent is running, login to the server as the rtorrent user via remote terminal (eg Putty) and type "screen -list". If it tells you that there is a detached session named "rtorrent", rtorrent is running. Apache should be running automatically and ruTorrent is run by Apache so that should be ok (you can confirm that it is running by typing "sudo service apache2 status"). To check if ruTorrent is actually located in the correct dir, type "grep DocumentRoot /etc/apache2/sites-available/default". If the output tells you that it's located at "/var/www" for example, you should go to that dir with "cd /var/www" and check if rutorrent is located there (you can use "ls" to list the contents of a dir so typing "ls" while in the "/var/www" in this case, should include "rutorrent"
output:
Code:

XXX@HTPC:~$ screen -list
There is a screen on:
7943.rtorrent (02/14/2015 03:51:26 PM) (Detached)
1 Socket in /var/run/screen/S-XXX.

XXX@HTPC:~$ sudo service apache2 status
[sudo] password for XXX:
* apache2 is running
XXX@HTPC:~$ grep DocumentRoot /etc/apache2/sites-available/default
grep: /etc/apache2/sites-available/default: No such file or directory
XXX@HTPC:~$ grep DocumentRoot /etc/apache2/sites-available/default
grep: /etc/apache2/sites-available/default: No such file or directory

XXX@HTPC:~$ cd /var/www
XXX@HTPC:/var/www$ ls
html rutorrent

Very weird huh? When I navigate to 192.168.1.36/rutorrent I get "The requested URL /rutorrent was not found on this server.

Apache/2.4.7 (Ubuntu) Server at 192.168.1.36 Port 80"
 

simur612

Member
May 25, 2018
879
0
16
Very weird huh?
Since you're running apache 2.4.7 and there's a "/var/www/html" dir, that's most likely your root webdir. Type in terminal "mv /var/www/rutorrent /var/www/html" and everything will probably start working
btw, if you had read the guide more carefully, you would've known about this and how to tell the script about it (it's the first line actually) wink.gif
 

lisas4567

Member
May 25, 2018
773
0
16
Since you're running apache 2.4.7 and there's a "/var/www/html" dir, that's most likely your root webdir. Type in terminal "mv /var/www/rutorrent /var/www/html" and everything will probably start working
btw, if you had read the guide more carefully, you would've known about this and how to tell the script about it (it's the first line actually) wink.gif
Wow I totally skipped over that first line, and didn't realize that running apache 2.4.7 was an issue. Thanks for the work on the original guide as well as the assistance here.
 

simur612

Member
May 25, 2018
879
0
16
All configuration and files do not depend on the system. So, you may use .rtorrent.rc file after putting it in proper location and all rutorrent data because its supposed to be in www catalog just after coping it.
 

randac56

Member
May 25, 2018
915
0
16
anyone can tell me if its possible to show the total Space used by torrents in 1 seedbox if you run 2 seedboxes on 1 server with 1 harddrive / 1 partition?

would be awesome if thats possible. Cuz for now i can just see the available space of the total discspace of the server
 

lisas4567

Member
May 25, 2018
773
0
16
anyone can tell me if its possible to show the total Space used by torrents in 1 seedbox if you run 2 seedboxes on 1 server with 1 harddrive / 1 partition?
I assume that with 2 seedboxes, you mean that there are 2 different rTorrent instances running on the same machine?
Assuming they both use different directories for the files seeding, I think you only need a few lines of code using popen to make a du call - perhaps you could make it a new ruTorrent plugin?
 

peshua19

Member
May 25, 2018
897
0
16
yeah i mean 2 instances of rutorrent on same machine. They both have different logins and are located in
/home/SeedboxA and /home/SeedboxB


a ruTorrent plugin what show the current amount of GB added in seedbox would be great.