This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

[HOWTO] Deluge inside a Jail

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

[HOWTO] Deluge inside a Jail

Post by mekonghigh »

Install Deluge inside a jail created with TheBrig.

Connect to NAS4Free with Putty and create a Deluge user

Code: Select all

pw useradd -n deluge -c "Deluge BitTorrent Client" -s /sbin/nologin -w no 
Enter the Jail

Code: Select all

jexec <jail_id> csh
pw useradd -n deluge -u <user_ID> -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
mkdir -p /home/deluge/.config/deluge
chown -R deluge:deluge /home/deluge/
Portsnap fetch extract
cd /usr/ports/net-p2p/deluge && make WITHOUT_X11=yes install clean 
Uncheck the box for GTK and accept the defaults for all dependencies.

Edit the startup script for the deamon to add deluge web interface
Now copy the following into the file /usr/local/etc/rc.d/deluged

Code: Select all

#!/bin/sh

# $FreeBSD: net-p2p/deluge/files/deluged.in 300897 2012-07-14 14:29:18Z beat $
#
# PROVIDE: deluged
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# MANDATORY:
#
# deluged_enable (bool):        Set to NO by default.
#                               Set it to YES to enable deluged.
#
# deluged_user (str):           The UNPRIVILEGED user to run as
#
# OPTIONAL:
#
# deluged_flags (str):          Set as needed
#                               See deluged(1) for more information
#
# deluged_confdir (path):       Set to /home/$deluged_user/.config/deluge
#                               by default
#
# deluged_loglevel (str):       Set to "error" by default
#
# deluged_logfile (path):       Set to /var/tmp/deluged.log by default
#
# deluged_weblogfile (path):    Set to /var/tmp/deluge-web.log by default

. /etc/rc.subr

name="deluged"
webname="deluge-web"
rcvar=deluged_enable

command=/usr/local/bin/${name}
webcommand=/usr/local/bin/${webname}
command_interpreter="/usr/local/bin/python2.7"

pidfile=/var/run/${name}/pid
webpidfile=/var/run/${webname}/pid

start_precmd=${name}_prestart
start_postcmd=${name}_poststart
stop_precmd=${name}_prestop
stop_postcmd=${name}_poststop

deluged_prestart()
{
        if [ "$deluged_user" = 'asjklasdfjklasdf' ]; then
                err 1 "You must set deluged_user to a real, unprivileged user"
        fi

        if [ ! -d "/var/run/${name}" ]; then
                if [ -e "/var/run/${name}" ]; then
                        unlink /var/run/${name}
                fi
                mkdir -p /var/run/${name}
        fi

        if [ ! -d "/var/run/${webname}" ]; then
                if [ -e "/var/run/${webname}" ]; then
                        unlink /var/run/${webname}
                fi
                mkdir -p /var/run/${webname}
        fi

        chmod 0755 /var/run/${name}
        chown -R $deluged_user /var/run/${name}
        chmod 0755 /var/run/${webname}
        chown -R $deluged_user /var/run/${webname}
}

deluged_poststart()
{
        if [ ! -f "${webpidfile}" ]; then
                su -m ${deluged_user} -c "${webcommand} ${webcommand_args}"
                echo "Starting ${webname}."
                echo `/bin/ps -auxw | /usr/bin/awk '/deluge-web/ && !/awk/ {print $2}'` > $webpidfile
        else
                GETPROCESSPID=`/bin/ps -auxw | /usr/bin/awk '/deluge-web/ && !/awk/ && !/sh/ {print $2}'`
                PIDFROMFILE=`cat ${webpidfile}`
                if [ "$GETPROCESSPID" = "$PIDFROMFILE" ]; then
                        echo "${webname} already running with PID: ${PIDFROMFILE} ?"
                        echo "Remove ${webpidfile} manually if needed."
                else
                        rm -f ${webpidfile}
                        su -m ${deluged_user} -c "${webcommand} ${webcommand_args}"
                        echo "Starting ${webname}."
                        echo `/bin/ps -auxw | /usr/bin/awk '/deluge-web/ && !/awk/ {print $2}'` > $webpidfile
                fi
        fi
}

deluged_prestop()
{
        PIDFROMFILE=`cat ${webpidfile}`
        kill ${PIDFROMFILE}

        [ -e "$webpidfile" ] && unlink $webpidfile
        [ -d "${webpidfile%/pid}" ] && rmdir ${webpidfile%/pid}

        [ -e "$deluged_weblogfile" -a ! -s "$deluged_weblogfile" ] &&
                unlink $deluged_weblogfile
}

deluged_poststop()
{
        [ -e "$pidfile" ] && unlink $pidfile
        [ -d "${pidfile%/pid}" ] && rmdir ${pidfile%/pid}

        [ -e "$deluged_logfile" -a ! -s "$deluged_logfile" ] &&
                unlink $deluged_logfile
}

load_rc_config $name

: ${deluged_enable:="NO"}
: ${deluged_user:="asjklasdfjklasdf"}
: ${deluged_confdir:="/home/${deluged_user}/.config/deluge"}
: ${deluged_loglevel:="error"}
: ${deluged_logfile:="/var/tmp/${name}.log"}
: ${deluged_weblogfile:="/var/tmp/${webname}.log"}

required_dirs="$deluged_confdir"
command_args="-c $required_dirs -L $deluged_loglevel -l $deluged_logfile -P $pidfile"
webcommand_args="-f -c $required_dirs -L $deluged_loglevel -l $deluged_weblogfile"

run_rc_command "$1" 
Set permisssions on the script

Code: Select all

 chmod 555 /usr/local/etc/rc.d/deluged 
Set the deamons run at startup

Code: Select all

 echo 'deluged_enable="YES"' >> /etc/rc.conf
echo 'deluged_user="deluge"' >> /etc/rc.conf 
Start and stop the deluge deamon to create the default config files

Code: Select all

/usr/local/etc/rc.d/deluged start
/usr/local/etc/rc.d/deluged stop
Add User to the authentication file

The next step is to create a Deluge user for clients/UIs to access the daemon remotely.
The auth file should contain lines with only ‘::’, replacing and with your choice and with the desired authentication level.
You can use your favourite text editor to achieve this or can be done with a one-line echo command e.g.:

Code: Select all

echo "alice:MyC0mpL3xPass:10" >> /home/deluge/.config/deluge/auth
Allow remote connections to deluge

edit /home/deluge/.config/deluge/core.conf
Change “allow_remote” from false to true.

Code: Select all

{
  "file": 1,
  "format": 1
}{
  "info_sent": 0.0,
  "lsd": true,
  "max_download_speed": -1.0,
  "send_info": false,
  "natpmp": true,
  "move_completed_path": "/root",
  "peer_tos": "0x00",
  "enc_in_policy": 1,
  "queue_new_to_top": false,
  "ignore_limits_on_local_network": true,
  "rate_limit_ip_overhead": true,
  "daemon_port": 58846,
  "torrentfiles_location": "/root",
  "max_active_limit": 8,
  "geoip_db_location": "/usr/local/share/GeoIP/GeoIP.dat",
  "upnp": true,
  "utpex": true,
  "max_active_downloading": 3,
  "max_active_seeding": 5,
  "allow_remote": true,
  "outgoing_ports": [
    0,
    0
  ],
  "enabled_plugins": [],
  "max_half_open_connections": 50,
  "download_location": "/root",
  "compact_allocation": false,
  "max_upload_speed": -1.0,
  "plugins_location": "/home/deluge/.config/deluge/plugins",
  "max_connections_global": 200,
  "enc_prefer_rc4": true,
  "cache_expiry": 60,
  "dht": true,
  "stop_seed_at_ratio": false,
  "stop_seed_ratio": 2.0,
  "max_download_speed_per_torrent": -1,
  "prioritize_first_last_pieces": false,
  "max_upload_speed_per_torrent": -1,
  "auto_managed": true,
  "enc_level": 2,
  "copy_torrent_file": false,
  "max_connections_per_second": 20,
  "listen_ports": [
    6881,
    6891
  ],
  "max_connections_per_torrent": -1,
  "del_copy_torrent_file": false,
  "move_completed": false,
  "autoadd_enable": false,
  "proxies": {
    "peer": {
      "username": "",
      "password": "",
      "hostname": "",
      "type": 0,
      "port": 8080
    },
    "web_seed": {
      "username": "",
      "password": "",
      "hostname": "",
      "type": 0,
      "port": 8080
    },
    "tracker": {
      "username": "",
      "password": "",
      "hostname": "",
      "type": 0,
      "port": 8080
    },
    "dht": {
      "username": "",
      "password": "",
      "hostname": "",
      "type": 0,
      "port": 8080
    }
  },
  "dont_count_slow_torrents": false,
  "add_paused": false,
  "random_outgoing_ports": true,
  "max_upload_slots_per_torrent": -1,
  "new_release_check": false,
  "enc_out_policy": 1,
  "seed_time_ratio_limit": 7.0,
  "remove_seed_at_ratio": false,
  "autoadd_location": "/root",
  "max_upload_slots_global": 4,
  "seed_time_limit": 180,
  "cache_size": 512,
  "share_ratio_limit": 2.0,
  "random_port": true,
  "listen_interface": ""
} 
Edit /etc/protocols and disable ipv6 by placing "#" in front of ipv6
Search for:

Code: Select all

ipv6	41	IPV6		# ipv6 
Change to:

Code: Select all

#ipv6	41	IPV6		# ipv6 
Start the deluge deamon

Code: Select all

/usr/local/etc/rc.d/deluged start 
Using your web browser go to http://IPAddress:8112 and log in with the password deluge.
Last edited by mekonghigh on 05 Dec 2013 03:16, edited 3 times in total.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by raulfg3 »

12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by mekonghigh »

With putty i can start "deluge-web" in Jail, but when i close putty "deluge-web" stop working.
How can i start "deluge-web" automatic when Jail starts?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by raulfg3 »

use user command 0 or 1 in jail config
usercommand 0.jpg
You do not have the required permissions to view the files attached to this post.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by mekonghigh »

Did not work.
It only work when i use putty.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by raulfg3 »

if deluge-web is a script use :

Code: Select all

/bin/sh /pathtodeluge/deluge-web
to start from user command 0
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by mekonghigh »


mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO]Deluge inside a Jail

Post by mekonghigh »

Now it works.
I have edited the first post.

hyperionx
NewUser
NewUser
Posts: 6
Joined: 06 Apr 2013 03:10
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by hyperionx »

Would love to get this working because transmission is complete and utter crap.

Having some problems though.

Here's what my nas4free thinks of your second code block.
Any ideas what Im doing wrong?

Code: Select all

nas4free:~# jexec Deluge csh
root@Deluge:/ # pw useradd -n deluge -u hyperion -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
pw: uid `0' has already been allocated
root@Deluge:/ # mkdir -p /home/deluge/.config/deluge
root@Deluge:/ # chown -R deluge:deluge /home/deluge/
chown: deluge: illegal group name
root@Deluge:/ # Portsnap fetch extract
Portsnap: Command not found.
root@Deluge:/ # cd /usr/ports/net-p2p/deluge && make WITHOUT_X11=yes install clean
/usr/ports/net-p2p/deluge: No such file or directory.

XeonNAS
NewUser
NewUser
Posts: 3
Joined: 11 Jun 2014 06:49
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by XeonNAS »

Great stuff, looking forward to trying Deluge.

Question though.....I have SickRage running in a jail already, any thoughts on adding Deluge to the same jail? Or preferred install is in new jail?

XeonNAS

XeonNAS
NewUser
NewUser
Posts: 3
Joined: 11 Jun 2014 06:49
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by XeonNAS »

Ok, got it working, but now have same problem as mekonghigh above, the user command 0 does not start the deluge-web, command I am using is:

Code: Select all

/bin/sh /usr/local/etc/rc.d/deluge-web
Otherwise if I start it via cli through ssh works fine!

XeonNAS
NewUser
NewUser
Posts: 3
Joined: 11 Jun 2014 06:49
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by XeonNAS »

Thanks, but I just found my own error!

Maybe update your instructions to remind people to change the deluge user in the scripts from the default asjklasdfjklasdf to the "deluge" user created early in your script, same in the deluge_web script. Using command 0 worked perfect after that. Also, the default deluge_web script in rc.d needs to be edited to to have deluge_web_enabled="YES".

Looks good so far, already tested with my privateinternetaccess.com SOCKS5 proxy and works well!

Great addition.

jay610
Starter
Starter
Posts: 22
Joined: 07 Jan 2013 17:19
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by jay610 »

Thanks to OP and to Xeon for piquing my interest with the SOCKS5.

I was wondering if you all have plugins working? I am not able to get any of the integrated ones going. When I tick the box for Scheduler and click through to another menu, when I come back it is unticked.

Based on some info around the webs I have a feeling this has to do with users/permissions, but I am a bit lost on how to proceed. I realise that this is not a deluge support forum but thought I would float this question while I continue to look for solutions.

zakroma
Starter
Starter
Posts: 22
Joined: 26 Jun 2012 07:43
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by zakroma »

jay610 wrote:Thanks to OP and to Xeon for piquing my interest with the SOCKS5.

I was wondering if you all have plugins working? I am not able to get any of the integrated ones going. When I tick the box for Scheduler and click through to another menu, when I come back it is unticked.

Based on some info around the webs I have a feeling this has to do with users/permissions, but I am a bit lost on how to proceed. I realise that this is not a deluge support forum but thought I would float this question while I continue to look for solutions.
Ok, so here's the solution for the plugins to work.
As jay610 figured out it all had to do with permissions and /var/tmp/deluge-web.log proved it:

Code: Select all

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Errno 13] Permission denied: '/.python-eggs'

The Python egg cache directory is currently set to:

  /.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
Python was angry that it couldn't access python-eggs folder to extract some needed files.

Solution is to set env variable to the accessible folder and set the right permissions.
I couldn't get setenv to make Python happy and just did this:

Code: Select all

mkdir /.python-eggs
chmod 777 /.python-eggs
That did the trick and now all plugins are working just fine! :)

sb00nk
experienced User
experienced User
Posts: 79
Joined: 16 Jul 2013 23:55
Status: Offline

Post by sb00nk »

There is a way to permanently set umask for the downloaded files?




Inviato premendo il bottone "invia"

User avatar
antonioion
NewUser
NewUser
Posts: 5
Joined: 20 Oct 2014 22:49
Location: Mexico city
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by antonioion »

Hi, I'm having problems to install deluge according to the instructions in my N4F 9.3.0.2 - Nayla (revision 1349), using TheBrig to create the jail.

All the steps are pretty clear and I didn't have problems in follow them, but when I try to start the daemon I receive the following error:

Code: Select all

root@Deluge 07:43 PM / # /usr/local/etc/rc.d/deluged start
Starting deluged.
Starting deluge-web.
root@Deluge 07:43 PM / # Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/deluge/main.py", line 230, in start_daemon
    Daemon(options, args)
  File "/usr/local/lib/python2.7/site-packages/deluge/core/daemon.py", line 161, in __init__
    component.start("PreferencesManager")
  File "/usr/local/lib/python2.7/site-packages/deluge/component.py", line 295, in start
    deferreds.append(self.components[name]._component_start())
  File "/usr/local/lib/python2.7/site-packages/deluge/component.py", line 124, in _component_start
    d = maybeDeferred(self.start)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 140, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 162, in start
    self._on_set_listen_interface)
  File "/usr/local/lib/python2.7/site-packages/deluge/config.py", line 312, in register_set_function
    function(key, self.__config[key])
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 258, in _on_set_listen_interface
    self._on_set_random_port("random_port", self.config["random_port"])
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 276, in _on_set_random_port
    self.session.listen_on(listen_ports[0], listen_ports[1], str(self.config["listen_interface"]).strip())
exceptions.RuntimeError: Protocol not supported

root@Deluge 07:43 PM / #
I don't understand which "Protocol" the message is referring to, or what I should install, configure or verify.
Any idea on the direction I should follow to correct this error?
NAS4Free 10.2.0.2.2433 (x64-embedded in USB stick)
ASRock C2750D4I, mini-ITX 8-core CPU, 32GB ECC DRAM, 2 ZFS mirrored pools (3TBx2) (1TBx2+1TBx2)
APC BackUPS as energy source and connected via USB to the system.

Test environment: VirtualBox 2048MB VM.

sb00nk
experienced User
experienced User
Posts: 79
Joined: 16 Jul 2013 23:55
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by sb00nk »

you probably have to use

Code: Select all

/usr/local/etc/rc.d/deluge_web start
instead, that runs the web gui and the daemon together


to me, i'm still looking for an answer to this question
There is a way to permanently set umask for the downloaded files?

Code: Select all

NASSERVER
firmware: 	11.1.0.4 - Atomics (revision 4528)
setup:		x64-embedded on 16GB microSD (Samsung MB-MP16D/EU)
case:		Cooler Master Silencio 550
mb:		ASROCK C2550D4I
cpu:		Intel Avoton C2550 @ 2.40GHz
ram:		32GB DDR3 ECC (4x Kingston KVR16E11/8)
hds:		4x2TB RaidZ (WD20EFRX)
cold spare:	1x WD20EFRX

BACKUP
NETGEAR ReadyNAS Duo
hds:		2x500GB Raid1 (WD5000AADS)
cold spare:	1x WD5000AADS

User avatar
antonioion
NewUser
NewUser
Posts: 5
Joined: 20 Oct 2014 22:49
Location: Mexico city
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by antonioion »

Thanks a lot for your answer sb00nk.

I did as you comment and at the beginning it seams to be OK, but when I hit the start daemon in the web UI the same error appears in the bash console.

It is something directly related with the daemon because the web UI allows me to put a magnet link, start and stop, etc. But obviously it just say it is started but no activity at all.

Code: Select all

root@Deluge 06:21 PM /home # /usr/local/etc/rc.d/deluge_web onestart
Starting deluge_web.
root@Deluge 06:21 PM /home # [ERROR   ] 18:23:03 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Protocol not supported
/usr/local/lib/python2.7/site-packages/deluge/main.py:230:start_daemon
/usr/local/lib/python2.7/site-packages/deluge/core/daemon.py:161:__init__
/usr/local/lib/python2.7/site-packages/deluge/component.py:295:start
/usr/local/lib/python2.7/site-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py:140:maybeDeferred
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:162:start
/usr/local/lib/python2.7/site-packages/deluge/config.py:312:register_set_function
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:258:_on_set_listen_interface
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:276:_on_set_random_port
]
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/deluge/main.py", line 230, in start_daemon
    Daemon(options, args)
  File "/usr/local/lib/python2.7/site-packages/deluge/core/daemon.py", line 161, in __init__
    component.start("PreferencesManager")
  File "/usr/local/lib/python2.7/site-packages/deluge/component.py", line 295, in start
    deferreds.append(self.components[name]._component_start())
  File "/usr/local/lib/python2.7/site-packages/deluge/component.py", line 124, in _component_start
    d = maybeDeferred(self.start)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 140, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 162, in start
    self._on_set_listen_interface)
  File "/usr/local/lib/python2.7/site-packages/deluge/config.py", line 312, in register_set_function
    function(key, self.__config[key])
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 258, in _on_set_listen_interface
    self._on_set_random_port("random_port", self.config["random_port"])
  File "/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py", line 276, in _on_set_random_port
    self.session.listen_on(listen_ports[0], listen_ports[1], str(self.config["listen_interface"]).strip())
exceptions.RuntimeError: Protocol not supported
[ERROR   ] 18:23:03 component:118 [Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Protocol not supported
/usr/local/lib/python2.7/site-packages/deluge/main.py:230:start_daemon
/usr/local/lib/python2.7/site-packages/deluge/core/daemon.py:169:__init__
/usr/local/lib/python2.7/site-packages/deluge/component.py:295:start
/usr/local/lib/python2.7/site-packages/deluge/component.py:124:_component_start
--- <exception caught here> ---
/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py:140:maybeDeferred
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:162:start
/usr/local/lib/python2.7/site-packages/deluge/config.py:312:register_set_function
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:258:_on_set_listen_interface
/usr/local/lib/python2.7/site-packages/deluge/core/preferencesmanager.py:276:_on_set_random_port
]



Another weird thing I noticed is that the daemon is like "partially" started, since I need to stop it if I want to restart it again.
Any other idea?

Regarding your question, I'm a very newbie user but may be through the login.conf file you can do what you want, give a look to this link:
https://www.freebsd.org/cgi/man.cgi?que ... &sektion=5
NAS4Free 10.2.0.2.2433 (x64-embedded in USB stick)
ASRock C2750D4I, mini-ITX 8-core CPU, 32GB ECC DRAM, 2 ZFS mirrored pools (3TBx2) (1TBx2+1TBx2)
APC BackUPS as energy source and connected via USB to the system.

Test environment: VirtualBox 2048MB VM.

sb00nk
experienced User
experienced User
Posts: 79
Joined: 16 Jul 2013 23:55
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by sb00nk »

maybe your configuration isn't correct, take a look to my config and script and compare with yours
the files are:
/etc/rc.conf
/user/local/etc/rc.d/deluged
/user/local/etc/rc.d/deluge_web
deluge_files.zip
to make him start on jail boot i use this command as "User command 0"

Code: Select all

/bin/sh /mnt/serverozzo/jail/deluge/usr/local/etc/rc.d/deluge_web
where /mnt/serverozzo/jail/deluge/ is the path of the deluge jail



Your was a good point to manage umask but it doesn't solve the problem (actually seems that nothing changes)
You do not have the required permissions to view the files attached to this post.

Code: Select all

NASSERVER
firmware: 	11.1.0.4 - Atomics (revision 4528)
setup:		x64-embedded on 16GB microSD (Samsung MB-MP16D/EU)
case:		Cooler Master Silencio 550
mb:		ASROCK C2550D4I
cpu:		Intel Avoton C2550 @ 2.40GHz
ram:		32GB DDR3 ECC (4x Kingston KVR16E11/8)
hds:		4x2TB RaidZ (WD20EFRX)
cold spare:	1x WD20EFRX

BACKUP
NETGEAR ReadyNAS Duo
hds:		2x500GB Raid1 (WD5000AADS)
cold spare:	1x WD5000AADS

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by mekonghigh »

antonioion wrote:Hi, I'm having problems to install deluge according to the instructions in my N4F 9.3.0.2 - Nayla (revision 1349), using TheBrig to create the jail.

All the steps are pretty clear and I didn't have problems in follow them, but when I try to start the daemon I receive the following error:
I did a reinstall in Finch/Qjail and i get the same error as you, but Deluge is working.

sb00nk wrote:There is a way to permanently set umask for the downloaded files?
Should be possible, but didn't work for me.
http://dev.deluge-torrent.org/wiki/User ... delugedJob

User avatar
antonioion
NewUser
NewUser
Posts: 5
Joined: 20 Oct 2014 22:49
Location: Mexico city
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by antonioion »

Thanks for your answer mekonghigh, after review and compare my configuration files with the ones sb00nk kindly shared with me now I was able to download some files. However the error remains the same.

I'm still intrigued about the error so I will keep digging (may be in the deluge forum) about this weird protocol not supported by deluged, but for now I'm considering deluge implementation ready and up and running in my NAS server.

Thanks again sb00nk and mekonghigh for your input.
NAS4Free 10.2.0.2.2433 (x64-embedded in USB stick)
ASRock C2750D4I, mini-ITX 8-core CPU, 32GB ECC DRAM, 2 ZFS mirrored pools (3TBx2) (1TBx2+1TBx2)
APC BackUPS as energy source and connected via USB to the system.

Test environment: VirtualBox 2048MB VM.

sb00nk
experienced User
experienced User
Posts: 79
Joined: 16 Jul 2013 23:55
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by sb00nk »

mekonghigh wrote: Should be possible, but didn't work for me.
http://dev.deluge-torrent.org/wiki/User ... delugedJob
i'm awared of the upstart procedure but isn't the method used in those jail setup, maybe it can be worty to try a switch to this procedure but not now :mrgreen:

Code: Select all

NASSERVER
firmware: 	11.1.0.4 - Atomics (revision 4528)
setup:		x64-embedded on 16GB microSD (Samsung MB-MP16D/EU)
case:		Cooler Master Silencio 550
mb:		ASROCK C2550D4I
cpu:		Intel Avoton C2550 @ 2.40GHz
ram:		32GB DDR3 ECC (4x Kingston KVR16E11/8)
hds:		4x2TB RaidZ (WD20EFRX)
cold spare:	1x WD20EFRX

BACKUP
NETGEAR ReadyNAS Duo
hds:		2x500GB Raid1 (WD5000AADS)
cold spare:	1x WD5000AADS

sb00nk
experienced User
experienced User
Posts: 79
Joined: 16 Jul 2013 23:55
Status: Offline

Re: [HOWTO] Deluge inside a Jail

Post by sb00nk »

with the execute plugin i've set a very simple script upon the torrent download completion that set rights on the entire download folder and subfolders
it can be improved in many ways but for the moment it's enaugh for my purpose

Code: Select all

#!/bin/sh

torrentid=$1
torrentname=$2
torrentpath=$3

log_file=/var/tmp/execute_script.log

echo "Torrent finished: " $torrentname :: $torrentpath :: $torrentid  >> $log_file

chmod -R 775 $torrentpath
echo "Folder chmodded: " $torrentpath >> $log_file

Code: Select all

NASSERVER
firmware: 	11.1.0.4 - Atomics (revision 4528)
setup:		x64-embedded on 16GB microSD (Samsung MB-MP16D/EU)
case:		Cooler Master Silencio 550
mb:		ASROCK C2550D4I
cpu:		Intel Avoton C2550 @ 2.40GHz
ram:		32GB DDR3 ECC (4x Kingston KVR16E11/8)
hds:		4x2TB RaidZ (WD20EFRX)
cold spare:	1x WD20EFRX

BACKUP
NETGEAR ReadyNAS Duo
hds:		2x500GB Raid1 (WD5000AADS)
cold spare:	1x WD5000AADS

Post Reply

Return to “Jails”