Ubuntu Seedbox with rtorrent | rutorrent | pureftpd | multi-user (optional)

randac56

Member
May 25, 2018
915
0
16
Hi

I cant get the rtorrent startup script to really work.

If i do sudo /etc/init.d/rtorrent start, it tells me this:

Sessions still open, not unmounting
Sessions still open, not unmounting
Starting rtorrent: rtorrentSessions still open, not unmounting
Sessions still open, not unmounting
Sessions still open, not unmountin

Everything starts so far so good. But when i reboot my computer it wont start rtorrent on startup. How can i see whats wrong?
 

peshua19

Member
May 25, 2018
897
0
16
sounds like your session is still open =)


I'm not sure which script you are using to start rtorrent, but you should add something to delete the old lock file perhaps.
 

saroos1

Member
May 25, 2018
718
0
16
thanks wonslung for your time. Im using the script that is posted in this HowTo. Could it be something wrong with the script? Can i track my startup somehow to see why my rtorrent wont start? Im pretty new at Linux.
 

simur612

Member
May 25, 2018
879
0
16
Just a small update to the guide.

g++-4.1 is now g++-4.3
libneon26 is now libneon27
libstdc++6-4.1-dev is now libstdc++6-4.3-dev

I would also add to that (for convenience): sudo locate nano

Thanks guys!
hey Wonslung... are these updates valid for all platforms? I thought it would help the newbs who would not be able to figure out why those packages are not downloading.

When I was doing the tutorial, I was doing it on Debian Squeeze for the ARM processor (Seagate Dockstar)
 

randac56

Member
May 25, 2018
915
0
16
thank you for the great tutorial!

I've a problem with this setup, I'm getting "network error" messages and torrent don't connect to peers and seeders.

Port are open (other torrent "single" client works great).

I compiled initially with the compiler of the guide and then reading this I tried compiling libtorrent an rtorrent with gcc 3.4.

results = same problem

I'm getting this:

Code:
(18:45:58) Outgoing connection to xx.10.54.12:40548
(18:45:58) Outgoing connection to xx.1x72.198.100:38088
(18:45:58) Outgoing connection to xx.1x.175.30:57477
(18:45:58) Outgoing connection to xx.4x.164.25:20117
(18:45:58) Outgoing connection to 1xx.6.1x1.35:38196
(18:45:58) Outgoing connection to xxx.1x3.x39.249:6881
(18:45:58) Outgoing connection to xx.17x.2x4.188:11982
(18:45:58) Outgoing connection to xxx.1x4.2x4.33:52935
(18:45:58) Outgoing connection to xx.27.x3.108:48146
(18:45:58) Outgoing connection to xx.1x9.239.206:17068
(18:45:58) Outgoing connection to xx.76.1.184:13301
(18:45:58) Outgoing connection to xx.156.81.170:13765
(18:45:58) Outgoing connection to 1xx.167.43.214:29635
(18:45:58) Outgoing connection to xx.157.234.47:33221
(18:45:58) Outgoing connection to 1xx.48.226.119:22374
(18:45:58) Outgoing connection to xx.16.96.27:37790
(18:45:58) Outgoing connection to xx.149.13.18:42967
(18:45:58) Handshake failed: xx.152.10.230:25955 - network error
(18:45:58) Handshake failed: xx.48.226.119:22374 - network error
(18:45:58) Handshake failed: xx.81.16.250:6555 - network error
(18:45:58) Handshake failed: xx.156.81.170:13765 - network error
(18:45:58) Handshake failed: xxx.104.7.140:65535 - network error
(18:45:58) Outgoing connection to xx.135.97.202:37997
(18:45:58) Outgoing connection to xx.68.144.37:37614
(18:45:58) Outgoing connection to xx.69.40.226:65535
(18:45:58) Outgoing connection to xx.2x9.223.7:19813
(18:45:58) Outgoing connection to xxx.1xx.70.242:63216
(18:45:58) Handshake failed: xxx.26.xx.28:17006 - network error
(18:45:58) Handshake failed: xx.135.xx.202:37997 - network error
help!!
 

saroos1

Member
May 25, 2018
718
0
16
great tutorial works perfect for me thanks only fuzzy part about this tut is setting up linux firewall but many thanks for the effort A+ tutorial
 

simur612

Member
May 25, 2018
879
0
16
great tutorial works perfect for me thanks only fuzzy part about this tut is setting up linux firewall but many thanks for the effort A+ tutorial
In all reality, you don't have to set up a firewall. My take on it is: If you are running a seedbox remotely then it's not that big of a deal, and if you are running it at home you probably have a good firewall/router running in front of it.


Of course, there is nothing wrong with setting up the firewall. I tend to use pf on FreeBSD

If you really need a more "simple" linux firewall look at "shorewall"

It's designed to be much more "human readable"
 

randac56

Member
May 25, 2018
915
0
16
I'm having nearly the same problem however I'm 99% sure I have the correct versions installed as I just copy/paste the commands. The other problem I had was that I was unable to start rtorrent via the command
Code:
rtorrentcommand from the user I created (I reallowed root) even thought everything past that point seemed to work.
 

peshua19

Member
May 25, 2018
897
0
16
What error are you getting?

Try an absolute path, eg. /usr/bin/rtorrent or /usr/local/bin/rtorrent
 

saroos1

Member
May 25, 2018
718
0
16
Ah I meant to include that whoops. The error I'm getting is:
Code:
Could not lock session directory: "/home/downloads/rtor/.session/", Permission deniedThat's both with and without using an absolute path.
 

simur612

Member
May 25, 2018
879
0
16
tbat error tells you exactly what the issue is.

you created a session directory but you likely did it as root or some other user.

let's assume your user is named dork
you'd run the following command:
Code:
chown -R dork:dork /home/dork/
 

randac56

Member
May 25, 2018
915
0
16
Ah I meant to include that whoops. The error I'm getting is:
Code:
Could not lock session directory: "/home/downloads/rtor/.session/", Permission deniedThat's both with and without using an absolute path.
The only times i have gotten that error is when rtorrent was already running and i manually reloaded the .rtorrent.rc, although what wonslung said about chowning the user dir could also be the problem/fix.
This is what rtorrent gives me when I start it:
Code:
(14:28:30) Using 'epoll' based polling.
(14:28:30) Using 'epoll' based polling.
(14:28:30) Could not read resource file: ~/.rtorrent.rc.
If that's all the output you are getting it looks like you didn't compile rtorrent with xmlrpc because then you should get this (although maybe it doesn't initialize XMLRPC because it cannot read you .rtorrent.rc)
Code:
(14:28:30) Using 'epoll' based polling.
(14:28:30) Using 'epoll' based polling.
(14:28:30) XMLRPC initialized with 831 functions.
In that output of you it also mentions that it cannot read the resource file (~/.rtorrent.rc) so you might want to check if there's nothing wrong in there. You could always post it here (in code tags) so someone could have a look at it.
Again, make sure you are not trying to start up rtorrent when it's already running as that will cause errors with the resource file.
 

randac56

Member
May 25, 2018
915
0
16
I figured that was the problem with not being able to lock the directory so I tried changing the owner before (and again). I killed the process and tried running it but still no luck, same error. When I reboot the server the screened rtorrent process owner is rtor, user rtor, and group rtor. This is what my /home/rtor/.rtorrent.rc file says:
Code:
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
#
# Based on original .rtorrent.rc file from http://libtorrent.rakshasa.no/
# Modified by Lemonberry for rtGui http://rtgui.googlecode.com/
#
# This assumes the following directory structure:
#
# /Torrents/Downloading - temporaray location for torrents while downloading (see "directory")
# /Torrents/Complete - Torrents are moved here when complete (see "on_finished")
# /Torrents/TorrentFiles/Auto - The 'autoload' directory for rtorrent to use. Place a file
# in here, and rtorrent loads it #automatically. (see "schedule = watch_directory")
# /Torrents/Downloading/rtorrent.session - for storing rtorrent session information
#

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
max_peers = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = -1
max_peers_seed = -1

# Maximum number of simultanious uploads per torrent.
max_uploads = 50

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 0

# Default directory to save the downloaded torrents.
directory = /home/downloads/rtor

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/downloads/rtor/.session

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/home/downloads/rtor/watch/*.torrent
schedule = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low. */
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,stop_on_ratio=200,200M,2000


# When the torrent finishes, it executes "mv -n <base_path> ~/Download/"
# and then sets the destination directory to "~/Download/". (0.7.7+)
# on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/home/downloads/rtor/complete/ ;d.set_directory=/home/downloads/<username>/complete/"

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no

# Port range to use for listening.
port_range = 55995-56000

# Start opening ports at a random position within the port range.
#port_random = yes

scgi_port = 127.0.0.1:5000

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

# Set whetever the client should try to connect to UDP trackers.
#use_udp_trackers = no

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = disable

# UDP port to use for DHT.
#
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
peer_exchange = no

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

# Max number of files to keep open simultaniously.
#max_open_files = 128

# Number of sockets to simultaneously keep open.
#max_open_sockets = <no default>


# Example of scheduling commands: Switch between two ip's every 5
# seconds.
#schedule = "ip_tick1,5,10,ip=torretta"
#schedule = "ip_tick2,10,10,ip=lampedusa"

# Remove a scheduled event.
#schedule_remove = "ip_tick1"
 

peshua19

Member
May 25, 2018
897
0
16
These dont really look right to me:
Code:
directory = /home/downloads/rtor
session = /home/downloads/rtor/.session
schedule = watch_directory,5,5,load_start=/home/downloads/rtor/watch/*.torrent
Unless you really have it like that? From what you said before I would think it should be more like:
Code:
directory = /home/rtor/downloads/
session = /home/rtor/.session/
schedule = watch_directory,5,5,load_start=/home/rtor/watch/*.torrent
This could also explain the session dir not being able to be locked (since it doesnt exist)
Maybe you should uncomment the min_peers as well, not sure if it will give any errors because you have that commented and then later says you want the min_peers_seed to be the same as min_peers (which is commented).

I would also suggest logging in with your rtor using manually and try to run rtorrent and see if you get any errors (before starting to use it as a deamon through init.d and before starting to combine it with ruTorrent) to find out possible errors.
 

saroos1

Member
May 25, 2018
718
0
16
Thanks for the help, that fixed my problem. Those original directories did exist but creating the /rtor/.session and changing the file did it. The only error message I'm getting now is that rtorrent can't access the stat program but I'm assuming that's just a problem with the plugin.
 

randac56

Member
May 25, 2018
915
0
16
First thank you so much for this guide! I went from knowing little about linux a few days ago, to almost having this working. I do have a few questions regarding this installation. I have had to log in as root in order to give permission for some of these commands to work. I know that is not best practice, but could find no other way to execute the commands without running in root. This is also where I am running into a few problems I believe. First I get the following error message when trying to execute

Code:
sudo chown -R <username>:<username> <username>

chown: cannot access `****': No such file or directory
Secondly, I get the following when trying to execute rtorrent from user

Code:
****@******:~$ rtorrent
rtorrent: Could not lock session directory: "/home/downloads/****/.session/", Permission denied

I am running Ubuntu Server 10.10, Thanks!!!