Openmediavault + Deluge 1.3.11

[UPDATE to Deluge 1.3.11] Installation – Deluge 1.3.6

Openmediavault is a Debian based lightweight OS with web management control system. For more information go here. While deluge  is just another torrent client but has the most beautiful web interface (see image 1.1) out there for torrent client (may be just be. :)).

For this installation I will be using root user to run deluge but you can use any other user.

deluge-1-3-10
Image 1.1 – Deluge 1.3.10 Web Interface

For Deluge  1.3.11, there is no direct way to install it in OS (e.g repo or deb). So we need to compile it from tar.bz package and install it.

Lets first install application dependent package

apt-get install python python-twisted python-twisted-web python-openssl python-simplejson python-setuptools intltool python-xdg python-chardet geoip-database python-libtorrent python-notify python-pygame python-glade2 librsvg2-common xdg-utils python-mako

Now we need to download deluge tar package.

Now unpack the package

tar xvzf /root/deluge-1.3.11.tar.gz
cd deluge-1.3.11

After this we need to download libtorrent

nano get_libtorrent.sh
# update url to this >> LT_URL=https://svn.code.sf.net/p/libtorrent/code/
sh get_libtorrent.sh
cd libtorrent/include
sh get_asio.sh
cd ..
sh autotool.sh
./configure --enable-python-binding
make
make install

clean python environment

cd /root/deluge-1.3.11
python setup.py clean

Now build the deluge package and install it.

python setup.py build
python setup.py install

After installation we need to do few thing to make deluge up and running.

1. Setup daemon

2. Setup Web Interface

For daemon, create file with name deluge-daemon in /etc/init.d/deluge-daemon

nano /etc/init.d/deluge-daemon

Now copy the following text into it.(For some reason copying didn’t work for me in fresh install so Download File from http://db.tt/OR6DikLt if it didn’t work for you too)

#!/bin/sh
### BEGIN INIT INFO
# Provides: deluge-daemon
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemonized version of deluge and webui.
# Description: Starts the deluge daemon with the user specified in
# /etc/default/deluge-daemon.
### END INIT INFO
# Author: Adolfo R. Brandes
# Modified: Sami OlmariPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=”Deluge Daemon”
NAME1=”deluged”
NAME2=”deluge-web”
DAEMON1=/usr/local/bin/deluged
DAEMON1_ARGS=”-d -l /var/log/deluged.log -L warning”
DAEMON2=/usr/local/bin/deluge-web
DAEMON2_ARGS=”-p 8112 -l /var/log/deluge-web.log -L warning”
PIDFILE1=/var/run/$NAME1.pid
PIDFILE2=/var/run/$NAME2.pid
PKGNAME=deluge-daemon
SCRIPTNAME=/etc/init.d/$PKGNAME# Exit if the package is not installed
[ -x “$DAEMON1” -a -x “$DAEMON2” ] || exit 0# Read configuration variable file if it is present
[ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

if [ -z “$RUN_AT_STARTUP” -o “$RUN_AT_STARTUP” != “YES” ]
then
log_warning_msg “Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it.”
exit 0
fi

if [ -z “$DELUGED_USER” ]
then
log_warning_msg “Not starting $PKGNAME, DELUGED_USER not set in /etc/default/$PKGNAME.”
exit 0
fi

#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon –start –background –quiet –pidfile $PIDFILE1 –exec $DAEMON1 \
–chuid $DELUGED_USER –user $DELUGED_USER –test > /dev/null
RETVAL1=”$?”
start-stop-daemon –start –background –quiet –pidfile $PIDFILE2 –exec $DAEMON2 \
–chuid $DELUGED_USER –user $DELUGED_USER –test > /dev/null
RETVAL2=”$?”
[ “$RETVAL1” = “0” -a “$RETVAL2” = “0” ] || return 1

start-stop-daemon –start –background –quiet –pidfile $PIDFILE1 –make-pidfile –exec $DAEMON1 \
–chuid $DELUGED_USER –user $DELUGED_USER — $DAEMON1_ARGS
RETVAL1=”$?”
sleep 2
start-stop-daemon –start –background –quiet –pidfile $PIDFILE2 –make-pidfile –exec $DAEMON2 \
–chuid $DELUGED_USER –user $DELUGED_USER — $DAEMON2_ARGS
RETVAL2=”$?”
[ “$RETVAL1” = “0” -a “$RETVAL2” = “0” ] || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred

start-stop-daemon –stop –quiet –retry=TERM/30/KILL/5 –user $DELUGED_USER –pidfile $PIDFILE2
RETVAL2=”$?”
start-stop-daemon –stop –quiet –retry=TERM/30/KILL/5 –user $DELUGED_USER –pidfile $PIDFILE1
RETVAL1=”$?”
[ “$RETVAL1” = “2” -o “$RETVAL2” = “2” ] && return 2

rm -f $PIDFILE1 $PIDFILE2

[ “$RETVAL1” = “0” -a “$RETVAL2” = “0” ] && return 0 || return 1
}

case “$1” in
start)
[ “$VERBOSE” != no ] && log_daemon_msg “Starting $DESC” “$NAME1”
do_start
case “$?” in
0|1) [ “$VERBOSE” != no ] && log_end_msg 0 ;;
2) [ “$VERBOSE” != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ “$VERBOSE” != no ] && log_daemon_msg “Stopping $DESC” “$NAME1”
do_stop
case “$?” in
0|1) [ “$VERBOSE” != no ] && log_end_msg 0 ;;
2) [ “$VERBOSE” != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg “Restarting $DESC” “$NAME1”
do_stop
case “$?” in
0|1)
do_start
case “$?” in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
exit 3
;;
esac

:

Now change permission of deluge-daemon file.

chmod 755 /etc/init.d/deluge-daemon

To run deluge at startup, we need add deluge daemon at startup list.

update-rc.d deluge-daemon defaults

Now we need add user in deluge configuration file.

nano /etc/default/deluge-daemon

# Configuration for /etc/init.d/deluge-daemon

# The init.d script will only run if this variable non-empty.
DELUGED_USER=root # !!!CHANGE THIS!!!!

# Should we run at startup?
RUN_AT_STARTUP=YES

and at line 4,  change “” to root

To start daemon

invoke-rc.d deluge-daemon start

Goto your browser and enter

[your server id]:8112

 It will ask for password. The default password is deluge

1. Click on connection manager
2. Click on connect

daemon
Image 1.1 – Deluge 1.3.6 Web Interface

Its best to change default password to something else. Go to Preference next to connect manager -> interface -> and change password

Password
Image 1.2 – Deluge 1.3.6 Web Interface
End of  Deluge 1.3.6 installation
Start of Optional Section for deluge

If you are like me who have Plex Media Server installed then you might want to configure your deluge for plex. Plex looks into different folder to collect your media file. And you might want deluge to move you download files to relevant folders. While the process that I am going to talk about is not fully automatic it will make life easy.

First thing is to auto add torrent files in deluge. For this you need to install deluge plugin “AutoAdd”. Autoadd can look into different folder for torrent and can apply setting according to those folder.

Goto here to download Autoadd plugin. It’s a egg file.

egg
Image 2.1 – Deluge 1.3.6 Web Interface

Ahh, the only problem with Autoadd plugin is that it has not yet got web ui to configure it. If you installing deluge in Debian then you can use GUI interface to configure, if you have not got GUI then (install lite weight desktop lxde + VNC :)), OR may be you can use terminal to configure Autoadd manually. * (Its possible to edit configure to setup Autoadd but I have never try this way – its purely experimental)

All the deluge configuration files are in /root/.config/deluge,

Editing autoadd.conf file.

nano /root/.config/deluge/autoadd.conf

{
“file”: 1,
“format”: 1
}{
“watchdirs”: {
“1”: {
“max_download_speed”: 0.0,
“move_completed_path”: “/path/to/move/your/downloaded/files“,
“remove_at_ratio_toggle”: false,
“label_toggle”: false,
“max_upload_slots”: 0,
“download_location_toggle”: false,
“append_extension_toggle”: true,
“stop_at_ratio_toggle”: false,
“move_completed_toggle”: true,
“max_connections”: 0,
“max_upload_speed_toggle”: true,
“auto_managed_toggle”: true,
“max_connections_toggle”: false,
“download_location”: “/root”,
“label”: “downloading-give a label here “,
“max_upload_speed”: 80.0,
“max_download_speed_toggle”: false,
“stop_ratio_toggle”: false,
“auto_managed”: true,
“abspath”: “/path/to/download/folder/of/torrent/file“,
“add_paused_toggle”: false,
“stop_at_ratio”: false,
“move_completed”: true,
“path”: “/path/to/download/folder/of/torrent/file“,
“append_extension”: “.added”,
“add_paused”: true,
“queue_to_top_toggle”: false,
“queue_to_top”: true,
“enabled”: true,
“remove_at_ratio”: true,
“stop_ratio”: 0.0,
“max_upload_slots_toggle”: false
}
},
“next_id”: 3
}

In GUI, it look like this,

option
Image 3.1 – Autoadd option – GUI

[ Explained ]

/path/to/move/your/downloaded/files -> TV

“append_extension”: “.added”, -> Append extension after adding [.added]

“move_completed”: true,
“path”: “/path/to/download/folder/of/torrent/file”, -> Set move completed location [English]

“max_upload_speed”: 80.0, -> max upload speed [80.0]

Next thing we need to make sure its enable in plugin section. Go to Preferences>>Plugins>>check AutoAdd >> Apply>> Close

There are other useful plugin like label and blocklist. While label is similar to autoadd its usually use to label the torrent that you are downloading and can have extra option similar to autoadd. Fortunately label has web UI to configure.

Go to plugin section to enable it and you might need to restart the daemon too.

Lable - Deluge
Image 4.1 – Deluge 1.3.6 – Label

You can have lots of labels for different purpose 🙂 . For more information about deluge please check reference link at the button of this page.

Now in Plex

plex
Image 5.1 – Plex Web Manager

Comment and suggest are always welcome.. 🙂

End of Optional Section for deluge
Advertisements

42 thoughts on “Openmediavault + Deluge 1.3.11

  1. i cannot install this due to an error in /etc/init.d/deluge-daemon

    it says so:

    root@OMV:~# invoke-rc.d deluge-daemon start
    /etc/default/deluge-daemon: 4: root: not found
    /etc/init.d/deluge-daemon: 27: !=: not found

    when trying to start the daemon it says

    Not starting deluge-daemon, edit /etc/default/deluge-daemon to start it. … (wa rning).

    I am pretty much Linux newbie….so pleeeeease :)) Help

  2. Newbies huh!.. 😀 everyone are newbies at start so no worries, what you need to do is download

    and replace the one you have in /etc/init.d and run

    chmod 775 /etc/initd/deluge-demon

    and

    invoke-rc.d deluge-daemon start

    also make sure this file

    nano /etc/default/deluge-daemon

    has root as user too.

  3. hello,
    i have done that…it still says so:
    Not starting deluge-daemon, edit /etc/default/deluge-daemon to start it. … (warning).

    my deluge-daemon contains the following…(i have removed all comments to exclude any typewriting errors…)

    DELUGED_USER=root

    RUN_AT_STARTUP=YES

    thanks for the help and these really nice tutorials in advance…thats what makes starting with linux bearable…:)

    • I think I need to see your log before I ask you do anything,
      go to terminal and run

      deluge -L info -l /root/deluge.log

      and post the deluge.log link here.. just link not content (you can upload that to dropbox, pastebin etc)

      • I think you have not compile the deluge properly.. can you please run everything from the beginning.. it does not harm to do that again, first delete deluge folder from root and do everything from the beginning.. 😀

        till End of Deluge 1.3.6 installation

  4. when running this command i get the following…maybe this is the problem?
    linux-x86_64′ does not exist — can’t clean it
    -bash: build/lib.linux-x86_64-2.6: No such file or directory
    root@OMV:~/deluge-1.3.6# ‘build/scripts-2.6’ does not exist — can’t clean it
    > ‘build/lib.linux-x86_64-2.6’ does not exist — can’t clean it
    -bash: build/scripts-2.6: No such file or directory
    root@OMV:~/deluge-1.3.6# ‘build/bdist.linux-x86_64’ does not exist — can’t clean it
    > ‘build/scripts-2.6’ does not exist — can’t clean it
    -bash: build/bdist.linux-x86_64: No such file or directory
    root@OMV:~/deluge-1.3.6# root@OMV:~/deluge-1.3.6#
    -bash: root@OMV:~/deluge-1.3.6#: No such file or directory
    root@OMV:~/deluge-1.3.6#

    • that log didn’t help.. deluge is trying to run GUI version of deluge but OMV don’t have GUI so its giving error..

      can you post the output of

      python setup.py build
      python setup.py install

      (of course not the content, just the link to content ) thanks.. 🙂

      • from this I can confirm that you have succesfully install deluge.. 😀 .. all we need to do is fix deluge daemon..

        can you run deluged in terminal

        root@Homv:~# deluged
        root@Homv:~# setsid deluge-web -p 8112

        go to you client browser, and in url -> [serverip]:8112
        if this runs then we can confirm that daemon and web port is fine too, then we can move to fix /etc/init.d/ script

        BTW, after you download deluge daemon from dropbox did you delete its txt extension or not??

    • you mean it worked with daemon script after you copied it or the command that I post worked??

      I am not sure what’s wrong with daemon script, can you post script from /etc/init.d/ and /etc/default for deluge, let me see if there is anything wrong in the script, mine works just fine .. 🙂 b

      • I am experiencing something weird…after installing deluge, i noticed that plex media server wasnt working properly anymorex, precisely i could not get tolog in to my plex anymore…after trying to remove plex media server for reinstall, i got a couple of error messages also regarding the deluge daemon…maybe that is the problem?

      • humm I don’t think deluge and Plex are link up.. cause they are completely different application. I think you have problem with system may be something is missing or corrupted.. if you have time do a fresh installation 😀 by doing that firstly you will learn more things this way, second you will remove any problem with the system and third you will get used to linux.. 😀

  5. Thats what i was going to do anyway tomorrow…i am planning to install omv sardaukar…the plex media server, deluge, and the vnc remote desktop for easigr maintenance…at this point, all those worked until i installed deluge…maybe with fresh install it will be better…keep in touch tomorrow with pdates on the progress…is there an order for things to get done?

  6. Pingback: SickBeard + CouchPotato + Deluge + Plex | Linux+

  7. I installed delgue in my omv 0.5.x rig, I want to run a script when adding a torrent and when it ends using the excute plugin.

    1. Where do I put the script file?
    2. How do I call it correctly from deluge?

    I tried putting my script file (which copies a script from a shared directory – so I can edit it there, and then runs it) in the “/somthing dir” but when deluge tried to run the script it would either say “permisssion denied” or no file found.

    I tried telling deluge “echo “xxx”>/media/raidid/general/xxx.txt, but that got me permission denied.
    I am looking for instructions on how u can use the executer plugin with omv and deluge.

    • First of all, you can only execute script with whichever user account you are using to run deluge.. as for my tutorial, I am using root, so it can run any script,but if you are using different user then. user should have right to execute script.
      Second thing is you need to enable execute plugin under preference>> plugin in deluge,
      now in deluge preference, under execute, you can add event, you have two option, torrent add and torrent complete, so assign your scrip accordingly. In here you can give a location to your script, it should be sh.. not TXT change that to sh and do sudo chmod 775 /path/to/script.sh
      {its best you put your script in root folder of user. eg. /root/myScript.sh}
      For more info go to http://dev.deluge-torrent.org/wiki/Plugins/Execute

      • So I now have a working sickbeard (tpb), and deluge on my rig.
        The issue was that my scripts (amongst other things, but leading to this) were not run when sickbeard added torrent via the API. it seems that when sb added torrents via “deluge” torrent method, when they where finished, they do not move to finished state, but straight to seeging, so that the execute plugin never “fired”.

        When I added torrents manually, it moved to finsihed state. so what I did was move to Blackhole method, and changed my script (groovy, filebot) to use
        Process p = Runtime.getRuntime().exec(“python /sickbeard/autoProcessTV/mediaToSickbeard.py ${ut_path$} ${ut_name}”);
        }

        I can share my groovy scripts, they unpack, and call sickbeard back for me.

        Have you come across the fact that sb(tpb) api calls does not get deluge torrents to go to finished state.

        Also (and I do not know if this is sb or deluge issue), in the sb logs I constantly see:

        2013-12-30 23:00:49 WARNING CP Server Thread-3 :: API :: 10.100.102.1 – gave WRONG API KEY 0232958947025cc5d8b985c269d0e977. ACCESS DENIED

        My server is 10.100.102.7 and not 1 (which is the router), any chance this is interferring?

  8. it seems that when sb added torrents via “deluge” torrent method, when they where finished, they do not move to finished state, but straight to seeging, so that the execute plugin never “fired”,
    use label plugin in deluge to move the completed torrent to desire location and assign that location to sickbeard, you don’t need script to move it.. once the files is moved, sickbeard automatically scanned the files in given location (you don’t need to call it) and does its jobs (post-processing).. and I am not sure about why you getting that error in your sb log cause I don’t have such error..

  9. Pingback: Open Source NAS | Leic's Blog

  10. root@nas:~/deluge-1.3.6/libtorrent# ./configure –enable-python-binding
    checking whether make supports nested variables… yes

    Building libtorrent-rasterbar 0.16.12

    Checking for a C/C++ compiler to use:
    checking for gcc… gcc
    checking whether the C compiler works… no
    configure: error: in `/root/deluge-1.3.6/libtorrent’:
    configure: error: C compiler cannot create executables
    See `config.log’ for more details

  11. I have done it.. 😀 , after so many problem with boost lib ..if you got problem with boost while compiling libtorrent, this might help – purge all the libboost-python and

    rm /usr/local/lib/libboost*
    rm -r /usr/local/include/boost
    apt-get install bjam

    then download >> http://sourceforge.net/projects/boost/files/boost/1.36.0/

    ya I know its old but it works

    tar xvzf boost_1_36_0.tar.gz
    set BOOST_BUILD_PATH=/username/boost/tools/build/v2
    cd boost_1_36_0
    cd tools/build/v2
    nano user-config.jam

    and remove # infront of using gcc like below and save

    # Configure gcc (default version).
    using gcc ;
    bjam

    now install libboost-all-dev

    apt-get install libboost-all-dev

    and follow the above step to install deluge.. cheers

    also install svn too

  12. May I ask which version of omv you used in your guide? And which you currently are on? I’ve been reading through the comments and it seems omv 1.0 has problems with deluge. Just want to be on the safe side.

  13. I’m sorry to inform that I did not suceed in my quest to install deluge on omv. Mostly becouse of problems with installation on a virtual host.

    I’ll have to leave this guide for now but I’ll surely return someday. Thank you for your help and for taking your time to write this guide. I hope others suceed in my place.

  14. Enable Download Managers Testing repo on the Secondary tab of omv-extras.org. Just added a new version of the deluge plugin tonight.

  15. im still having problems with the boostlib… prob due to my novicness surrounding the matter… I only started using linux about 6 months ago but I have a solid command of the command line… pun. Anyway, I have all the current python libraries as well as subversion (svn.. right?) I have just been googling along installing packages as errors pop up but now i am stuck on configuring the python bindings

    checking whether the Boost::Python library is available… no
    configure: error: Unable to find Boost.Python library, this is required to build python bindings.

    It says all my packages are up to date and installed…
    Any help would be super schweet! tanks y’all PS thanks for the f-n awesome website! all this is such a great learning exp!
    Cheers
    -R

    • ya boostlib was the biggest problem to me as well, I had to purge entire boostlib and recompile from the scratch.

      Plz try this,
      from my previous comment

      I have done it.. 😀 , after so many problem with boost lib ..if you got problem with boost while compiling libtorrent, this might help – purge all the libboost-python and

      rm /usr/local/lib/libboost*
      rm -r /usr/local/include/boost
      apt-get install bjam

      then download >> http://sourceforge.net/projects/boost/files/boost/1.36.0/

      ya I know its old but it works

      tar xvzf boost_1_36_0.tar.gz
      set BOOST_BUILD_PATH=/username/boost/tools/build/v2
      cd boost_1_36_0
      cd tools/build/v2
      nano user-config.jam

      and remove # infront of using gcc like below and save

      # Configure gcc (default version).
      using gcc ;
      bjam

      now install libboost-all-dev

      apt-get install libboost-all-dev

      and follow the above step to install deluge.. cheers

      also install svn too

  16. Hello, I just finished setting up my Odroid. There is a way to get deluge installed from binaries. I found the solution here http://forum.openmediavault.org/index.php/Thread/14189-deluge-1-3-12/?postID=119983#post119983. I used your deluge-daemon script to get it running after modifying the location of deluged and deluge-webui. This way we can get updates. Thank you so much for this guide, I have been going back and forth on a lot of guides and without yours I would be a little lost, because I wanted to use Deluge. I love its web interface.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s