Howto: testing 0.6 using deluged + webui (headless *nix)
Posted: Sun Mar 09, 2008 8:01 am
I spent some time this evening getting deluged running with the webui client on my headless server. As the information is scarce here I'll post my exact steps. This is a "lets get it running quick to see how it is" so deluged is run as root (typically, an ill-advised method
).
Installation
1) Install the 0.6 branch from svn:
2) Setup deluged to run when server is booted. Add these lines to your /etc/inittab file (be very careful when editing this file -- make a backup before editing like so: "cp /etc/inittab /etc/inittab-save"):
3) Setup deluge client with webui to run when server is booted. Add these lines to your /etc/inittab file (again, be careful):
4) Kick off by the server and the client:
To see what is happening with deluged and the client simply run:
To connect to the web interface in your browser use an URL like this one:
Where 192.168.1.1 is replaced with the IP of your server. I'm assuming that deluge w/ webui uses port 8112 by default but I don't know (to find out, do "cat /var/log/deluge-webui.log" and it should say in the output what port it is running on -- at least for the first run). The default password is "deluge".
Bugs
- the client insisted my "Store all downoads in:" directory did not exist. I had to edit ~/.config/deluge/core.conf from this:
to this:
Of course, replace /mnt/sdb/torrents with wherever you want to store the downloads. Remember such bugs are to be expected as 0.6 is still in development. Reporting bugs is good. Complaining about bugs in development versions is very rude.
Security
Setting up deluge this way is bad because everything runs as root on the server. Lets setup deluge to run under a user account with a name of "dtor". I'm assuming the "dtor" user already exists (if not, consult your documentation on how to add a user and make sure the user is added with a home directory).
1) Create a directory in /var/log for logging that is owned by "dtor" (so the deluge process can write to it):
2) Edit /var/inittab to run the deluged and "deluge -u webui" as the "dtor" user from this:
To this:
One last gotcha
In the commands above that we put in /etc/inittab they all have a "5" as the second field. This is because my default runlevel is 5. It says so at the top of my /etc/inittab like so:
Yours might be different. You can just replace 5 with "345" and do "telinit -q" to get init to reprocess /etc/inittab.
No need to reboot
When you want to stop deluge, just edit /etc/inittab and put a "#" at the front of each line that starts a deluge process. Then at the shell as root run "telinit -q" and the processes will stop. When you want to launch deluge, simply remove the comment and run "telinit -q" again.
Help?
Got stuck? I'll try to check this thread. A good place to start is to first make sure you can run deluged and the client (using either "deludge -u webui" or "deluge -u null").
Remember you are testing a development branch. Do not complain when bugs are encountered but do check the bugs db to see if they have been reported and if not report the bug so that the developers are aware of it (I'm assuming that is the standard procedure on this project but I'm new so if I got it wrong please post).
Bug reports/tickets are here: http://dev.deluge-torrent.org/report

Installation
1) Install the 0.6 branch from svn:
Code: Select all
cd /usr/src
svn co http://svn.deluge-torrent.org/branches/deluge-0.6 deluge-0.6
cd deluge-0.6
python setup.py build
python setup.py install
Code: Select all
# run deluged (on port 58846) with logging to /var/log/deluged.log
dd:5:respawn:/usr/bin/deluged -d -p 58846 &> /var/log/deluged.log
Code: Select all
# run deluge webui with logging to /var/log/deluge-webui.log
dw:5:respawn:/usr/bin/deluge -u web &> /var/log/deluge-webui.log
Code: Select all
telinit q
Code: Select all
tail -f /var/log/deluged.log
tail-f/var/log/deluge-webui.log
Code: Select all
http://192.168.1.1:8112
Bugs
- the client insisted my "Store all downoads in:" directory did not exist. I had to edit ~/.config/deluge/core.conf from this:
Code: Select all
sS'download_location'
p21
S'/root'
p22
Code: Select all
sS'download_location'
p21
S'/mnt/sdb/torrents'
p22
Security
Setting up deluge this way is bad because everything runs as root on the server. Lets setup deluge to run under a user account with a name of "dtor". I'm assuming the "dtor" user already exists (if not, consult your documentation on how to add a user and make sure the user is added with a home directory).
1) Create a directory in /var/log for logging that is owned by "dtor" (so the deluge process can write to it):
Code: Select all
mkdir /var/log/deluge
chown -R dtor:users /var/log/deluge
Code: Select all
# run deluged (on port 58846) with logging to /var/log/deluged.log
dd:5:respawn:/usr/bin/deluged -d -p 58846 &> /var/log/deluged.log
# run deluge webui with logging to /var/log/deluge-webui.log
dw:35:respawn:/usr/bin/deluge -u web &> /var/log/deluge-webui.log
Code: Select all
# run deluged (on port 58846) with logging to /var/log/deluged.log
dd:5:respawn:su - dtor -c "/usr/bin/deluged -d -p 58846 &> /var/log/deluge/deluged.log"
# run deluge webui with logging to /var/log/deluge-webui.log
dw:5:respawn:su - dtor -c "/usr/bin/deluge -u web &> /var/log/deluge/deluge-webui.log"
In the commands above that we put in /etc/inittab they all have a "5" as the second field. This is because my default runlevel is 5. It says so at the top of my /etc/inittab like so:
Code: Select all
# Default runlevel.
id:5:initdefault:
No need to reboot
When you want to stop deluge, just edit /etc/inittab and put a "#" at the front of each line that starts a deluge process. Then at the shell as root run "telinit -q" and the processes will stop. When you want to launch deluge, simply remove the comment and run "telinit -q" again.
Help?
Got stuck? I'll try to check this thread. A good place to start is to first make sure you can run deluged and the client (using either "deludge -u webui" or "deluge -u null").
Remember you are testing a development branch. Do not complain when bugs are encountered but do check the bugs db to see if they have been reported and if not report the bug so that the developers are aware of it (I'm assuming that is the standard procedure on this project but I'm new so if I got it wrong please post).
Bug reports/tickets are here: http://dev.deluge-torrent.org/report