2009/01/18

WMU-6500FS - Deluge 1.1.0



The new deluge version is here!

Build result

[binary] [file list]
If you don't have the previous version (deluge-1.0.5) installed, follow the previous deluge post, install all the prerequisites and dependencies and come back here for the rest. Note that the deluge-1.0.5-gcclibs package is valid even for deluge-1.1.0, so don't get confused with its misleading name.
On the other hand if you have the deluge-1.0.5 installed, you have to clean it up first (while preserve all the already installed dependencies).

Stop the deluge daemon if it is running. You can do it via console:
box# deluge --ui=null
>>> halt
>>> quit
Thanks!

or forcibly:
box# killall deluged
Now uninstall the previous version:
dev# cd /mnt/C/
dev# ./filopack.sh --remove deluge-1.0.5
Configuration file .filopack/.config file found and used
Sure to remove deluge-1.0.5 locally at /mnt/C (y/n)?y
...
If you are not using the filopack packaging system, you can remove the previous version as follows:
box# cd /mnt/C/
box# wget http://filodej.ic.cz/filopack/.filopack/deluge-1.0.5.lst
box# xargs rm -f < deluge-1.0.5.lst
It is likely that deluge developers preserved the compatibility of configuration and the following step is not necessary, I just to be sure delete the configuration as well:
box# mv ~/.config/deluge{,.del}
Now we are ready to install the new version:
box# ./filopack.sh --install deluge-1.1.0
Sure to unpack deluge-1.1.0 locally at /mnt/C (y/n)? y
...
Now we are ready to try the daemon, still it is necessary to use the LD_PRELOAD prefix or deluged.sh script - now updated in order to support parameters (like -d for example) - see this post on mascat for details - if we are lucky, everything runs smoothly:
box# deluged.sh

Default GUI

It is possible to set a default GUI (if you prefer other than predefined GTK GUI):
box# deluge --set-default-ui=console
The default UI has been changed to console
It is nice that now it is not necessary to modify the configuration by hand (like it is described here).

Remote access

The CLI ui has been renamed from null to console. Notice that it is necessary to use LD_PRELOAD prefix just for daemon and GTK GUI, there is no need to use it for the console UI).
We can use it for enabling the remote access (we have to restart the daemon in order to make the change active):
box# deluge --ui=console
>>> config --set allow_remote True
>>> halt
>>> quit
Thanks!

box# deluged.sh

Authentication

Another new feature is the user authentication. For details see [Authentication] and [ThinClient settings]. Without adding a username and password to ~/.config/deluge/auth configuration file you won't be able to remotely connect to the daemon nor event see whether the daemon is running (which is a nice).

Edit: since the ~/.config/deluge/auth file initially does not contain trailing newline the instructions did not work, now it is updated appropriately
box# echo -n -e "\n<username>:<password>" >> ~/.config/deluge/auth
Be sure to append to the file, in case you rewrote the file you won't have been able to connect to it locally, since it initially contains a localclient record. If you accidentally rewrite the file, you can just delete it, restart the daemon and a ui (e.g. the console) and the default file containing localclient authentication info is created for you.

Web GUI

If you want to use the Web GUI (and new Ajax UI seems pretty good to me), now it is not necessary to run the web client on the same machine as daemon. Via the Web GUI you can connect to any daemon you want (not just localhost). Not sure whether I personally utilize it, but it seems to me like a nice feature.

That's all folks.
(The following text is just a (boring) build protocol, totally unnecessary for ordinary users ;-)

Build sequence

It was about the same like in previous version so just in short:

Remove the previous version:
dev# cd /mnt/C/
dev# ./filopack.sh --remove deluge-1.0.5
Configuration file .filopack/.config file found and used
Sure to remove deluge-1.0.5 locally at /mnt/C (y/n)?y
...
Init the timestamp for the new one:
dev# ./filopack.sh --init  deluge-1.1.0
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/deluge-1.1.0.ts
Download and extract the source:
dev# cd /usr/local/src
dev# wget http://download.deluge-torrent.org/source/1.1.0/deluge-1.1.0.tar.bz2
...
04:37:59 (55.28 KB/s) - `deluge-1.1.0.tar.bz2' saved [2196924/2196924]

dev# tar xjvf deluge-1.1.0.tar.bz2
dev# cd deluge-1.1.0
Setup the include and library paths:
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35
dev# export LDFLAGS=-L/mnt/C/sys/lib
Add the missing define:
nano libtorrent/include/libtorrent/socket.hpp

      #ifndef IPV6_V6ONLY
      #define IPV6_V6ONLY 26
      #endif

I did not find the libtorrent/src/memdebug.cpp, so undefining the content of this file is not necessary anymore.

Build the code and install the binaries:
dev# python setup.py build
...
dev# python setup.py install --prefix=/mnt/C/sys/
...
Try to run the daemon:
dev# deluged
dev# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
... issue wit h unresolved symbol is still the same. As a workaround the LD_PRELOAD prefix can be used. Let;s create scripts for it:
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluged \"\$@\" > /mnt/C/sys/bin/deluged.sh
dev# chmod +x /mnt/C/sys/bin/deluged.sh 
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluge \"\$@\" > /mnt/C/sys/bin/deluge.sh
dev# chmod +x /mnt/C/sys/bin/deluge.sh 
Now the daemon runs ok:
dev# deluged.sh
Let's try the GTK client:
dev# deluge --version
1.1.0
dev# deluge
...
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.1.0-py2.5-linux-i686.egg/deluge/ui/gtkui/common.py", line 

45, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
ChangeAs a fix we can change the extension:
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge/ui/gtkui/common.py
dev# deluge
Touch related files with older timestamps (in order to include them to the package):
dev# find /mnt/C/sys -path "*deluge*" -type f -exec touch {} \;
Then we are ready to create the package:
dev# cd /mnt/C/sys
dev# ./filopack.sh --pack deluge-1.1.0
...
I noticed that there was duplicity after the installation which made the package twice as big as was necessary: It seems to me that whole directory tree /mnt/C/sys/lib/python2.5/site-packages/deluge-1.1.0-py2.5-linux-i686.egg/deluge was redundant - directory /mnt/C/sys/lib/python2.5/site-packages/deluge had a similar content (including the huge libtorrent.so). I just dropped the former one and everything seems ok and package has 16MB (compared to 31MB).

15 comments:

Anonymous said...

Thanks for new build. Just updated to it, seems working OK.
P.S. Please verify "Authentication" chapter in your installation instruction. Recommended command
box# echo "username:password" >> ~/.config/deluge/auth
adds login&pass in the localhost string. That cause daemon inaccesiblity both local and remote.

Denier said...

Many thanks! Will give it a try ASAP. One quick remark though: One of the dependencies listed in the previous list is "deluge-1.0.5-gcclibs.tar.bz2." I take it the name of this file is a bit misleading, as you seem to be relying on this in order to make Deluge 1.1.0 work. Is that so? Would you consider changing the name to, say, "deluge-gcclibs.tar.bz2"?

Denier said...

I think your line of code @authentification has a missing parameter. Mine worked with \n.

filodej said...

@Al_Rider and @Aqualung: thanks for letting me know and sorry for the trouble. I have updated the post, the fixed command should work now.

@Aqualung: good point, I thought about renaming the deluge-1.0.5-gcclibs package, the problem is that the package name is used as an identifier in the filopack script and so I would have to preserve the old name (in some form) anyway (e.g. for possible package uninstallation). I do not know how many people out there is actually using the filopack script (probably few) but still I do not want to cause them needless trouble. Maybe I'll change my mind, for now I just updated the post and mentioned this issue.

Thanks,
Filodej

Anonymous said...

Thankyou filodej.
I am getting this error when I try to connect to my box from webui:


[root@Airlive_Storage C]# [ERROR ] 13:29:56 client:146 Socket or XMLRPC error: (111, 'Connection refused')

I run deluged.sh first, then deluge.sh with web as interface.

If I run webui in another windows machine and I try connect to the box I get:

--Deluge Error--
IOError : unsupported XML-RPC protocol
path : /connect
file : C:\Archivos de programa\deluge\Lib\site-packages\deluge\xmlrpclib.py in __init__, line 1413

--Input--
Storage {'other_uri': '192.168.1.70:58846', 'uri': 'other', 'submit': 'Connect'}

--Versions--
WebUi : 1.1.0r
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]:

--Traceback--
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\webui\lib\webpy022\webapi.py", line 310, in wsgifunc
result = func()
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\webui\lib\webpy022\request.py", line 131, in lambda
func = lambda: handle(inp, fvars)
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\webui\lib\webpy022\request.py", line 61, in handle
return tocall(*([x and urllib.unquote(x) for x in args] + fna))
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\webui\pages.py", line 321, in POST
utils.daemon_connect(uri)
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\webui\utils.py", line 198, in daemon_connect
sclient.set_core_uri(uri)
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\client.py", line 318, in set_core_uri
return self.core.set_core_uri(uri)
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\client.py", line 184, in set_core_uri
self.get_rpc_core()
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\ui\client.py", line 193, in get_rpc_core
self.rpc_core = xmlrpclib.ServerProxy(self._uri.replace("localhost", "127.0.0.1"), allow_none=True, transport=Transport())
File "C:\Archivos de programa\deluge\Lib\site-packages\deluge\xmlrpclib.py", line 1414, in __init__
raise IOError, "unsupported XML-RPC protocol"


Any idea?
Thanks again and sorry my english.

Denier said...

HI Filodej, how about compiling Deluge 1.1.1 please?

Thanks,

Aqualung

Anonymous said...

Hi,
i installed Deluge 1.1.0 and everything works fine,console and web UI work just fine,but i cant connect to the daemon from my PC with windows client, it shows red dot in connection manager...IP and port are correct,i tried to set different ports,bud no effect...i think i got the authentification OK too,in auth file i got the localhost and the other login below. thx for any help :) i wold use the webUI,but its just too slow :( i installed Deluge 1.1.0 and everything works fine,console and web UI work just fine,but i cant connect to the daemon from my PC with windows client, it shows red dot in connection manager...IP and port are correct,i tried to set difference ports,but no effect...i think i got the authentification OK too,in auth file i got the localhost and the other login below. thx for any help :) i wold use the webUI,but its just too slow :(

Luk said...

hi, thanks for this build. I need some help. After I run deluged or deluged.sh (in ash and bash) I have this:
/usr/bin/python: can't resolve symbol 'PyUnicodeUCS4_AsUnicode'
Can You help me?

filodej said...

Hi,
try this Q&A topic.
Hope it helps. If not, please, let me know.
Regards, Filodej

Luk said...

hi, thanks for answer, but... issue is not resolving. I did everything step by step (from your link). My version of python - 2.5. Your - 2.5.2. I can't change it (package from Joker site). Maybe problem is version??? What can I do? Any idea? Regards

filodej said...

Hi,
"My" version of python is built with 4-byte representation for Unicode characters. "Joker's" version is built with 2-byte representation. So it is not the python version what causes the problem, it is the difference of build configurations.

When I look at the symbols of "my" library the symbel is there:
box# nm /mnt/C/sys/lib/libpython2.5.so.1.0 | grep PyUnicodeUCS4_AsUnicode
0007ad94 T PyUnicodeUCS4_AsUnicode
0007ac50 T PyUnicodeUCS4_AsUnicodeEscapeString

You can try it for yourself and if you have the "Joker's" version of python then you probably find the PyUnicodeUCS2_* versions.

Also if you try the following:
box# python
Python 2.5.2 (r252:60911, May 3 2008, 16:19:27)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.maxunicode > 65535 and 'UCS4 build' or 'UCS2 build'

... you probably get the "UCS2 build" answer.

I am not sure what component is demanding the 4-byte symbol, it will be probably some of the deluge related stuff built by me. strace will tell you:

box# LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" strace -f /usr/bin/deluged

You can send the log you get and I can look at it to be sure. A library demanding the symbol should be at the very bottom of the log.

As far as I know at the moment the only reliable solution is to replace the "Joker's" python with "my" version (the deluge is built against). But do not forget to remove the Joker's version along with all its extensions (like libexpat) so you do not get into the same problems like Christos before (his situation was actually complementary to yours).

Regards,
Filodej

Luk said...

hi again :)
the log after LD_PRELOAD=... is very BIG. Can I "grep" something? regads

filodej said...

Just try to tail last 20-30 lines.
F.

iknowledge said...

Filodej, can you please tell me how to add transmission Bittorrent in startup. I have asked this question in Mascat forum. But to no avail.

Whenever there is a power failure, and the light comes back, the 6500FS restarts. The transmission bittorrent from joker does not automatically start at startup.

PLease provide me the steps. Appreciate ur help on this.

Regards,
iknowledge

filodej said...

Hi,
there are several places from where you can start the daemon.

The one is the directory
/tmp/mnt/C/sys/etc/start.d

All files present in this directory are executed when system starts. So you can create a symlink to the transmision daemon there.

Regards,
Filodej