2008/11/24

WMU-6500FS - Deluge torrent 1.0.5 (part IV)



Screenshots

Finally I found time to build the full version of deluge bittorrent client (version 1.0.5) and create a package for it.

Deluge 1.0.5 GTK client
(running on CoLinux with Debian 4.0, XMing server running on WinXP) Deluge 1.0.5 GTK client
(running on WinXP) Deluge 1.0.5 GTK client
(running on Ubuntu 8.04)

Build result

[binary] [file list]
Prerequisites: [JoKeR's minimal config] [JoKeR's essential libs]
For filopack system: [JoKeR's bash shell] [JoKeR's busybox extended]
Dependencies: [gcc libraries] [glib] [readline] [boost] [python] [setuptools] [DBus] [DBus-glib] [DBus-python] [pygobject] [pyxdg]
GUI dependencies: [X.Org] [Gtk+] [pycairo] [pygtk] [atk] [glade]
Edit: Regarding to this post it seems that [pygobject] and [pyxdg] packages are needed even for non-gui mode.

Overview

First I'll demonstrate the shortest path (given all the needed dependencies are already installed). Then I describe the build and package creation process, since I feel that such information can be helpful when something goes wrong.

Download & Install

We can utilize the filopack system for that purpose. In case we do not have it we can simply download it (and make executable) as follows:
box# cd /mnt/C
box# wget http://filodej.ic.cz/filopack/filopack.sh
box# chmod 755 filopack.sh
First action we have to do is to uninstall the previous Deluge version (assumed we have both Deluge 0.9.03 and ./filopack.sh installed on the box):
box# cd /mnt/C
box# ./filopack.sh --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)?y
...
Now we can download the package:
box# cd /mnt/C
box# ./filopack.sh --download deluge-1.0.5
[root@storage C]# ./filopack.sh --download deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Downloading package deluge-1.0.5 from http://filodej.ic.cz ...
connected!

Length: 68,332 [text/plain]
connected!

Length: 15,645,450 [application/x-tar]
And the last step is to install it:
box# ./filopack.sh --install deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Sure to unpack deluge-1.0.5 locally at /home/petr (y/n)?
...
Now, we are done (if we are lucky ;-)

I added scripts (deluge.sh and deluged.sh) which we can run in place of original loader scripts (deluge and deluged) which are working around the weird problems with dynamic loader missing some symbols.
box# cat /mnt/C/sys/bin/deluged.sh
LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged
So if you already have the /mnt/C/sys/bin/ directory in your PATH now instead of:
box# deluged
/usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
... you can simple type:
box# deluged.sh
It is great that the daemon mode is now supported and we can run the GTK GUI remotely (even so the demands of python runtime are relatively high for the box).
In following figures you can see the clients running on Ubuntu and WinXP both connected to the daemon running on the box. In previous figure there is also the client running on the box - it can be seen that its progress controls are way behind the real time and even the PC running client does not receive much information from the daemon. In such situations everything becomes reaaaalllllly sloooowwww as the box can't catch the train.

It is obvious that it is not a good idea to run GTK client directly on the box, since it pushes its HW resources really to its limits, but in is nice that it (no matter how slowly) works.

Build & Pack

Everything necessary for successful build was already described in previous three parts of this series, this part just collects the information and describes the whole building process step-by-step.

Same as in the previous case we have to uninstall the old Deluge version (0.9.03)
dev# cd /mnt/C
dev# ./filopack.sh --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)?
...
Now we are ready to start the building process. First thing we have to do is to create a timestamp file. With help of this file the packaging system determines what files are included to the resulting package.
dev# ./filopack.sh --init  deluge-1.0.5
Configuration file .filopack/.config file found and used
Timestamp written to file .filopack/deluge-1.0.5.ts
Now we can download and extract the sources.
dev# cd /usr/local/src/
dev# wget http://download.deluge-torrent.org/source/1.0.5/deluge-1.0.5.tar.bz2
...
dev# tar xjvf deluge-1.0.5.tar.bz2
dev# cd /usr/local/src/deluge-1.0.5
We have to do the following steps in order to make a successful build:
(For explanations see previous parts of this series)
Add proper paths to boost header files and libraries
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35
dev# export LDFLAGS=-L/mnt/C/sys/lib
Add missing IPV6 related macro to socket.hpp header file:
dev# nano libtorrent/include/libtorrent/socket.hpp
    add:
      #ifndef IPV6_V6ONLY
      #define IPV6_V6ONLY 26
      #endif
Disable the memory debugging (file libtorrent/src/memdebug.cpp) from the build. You can:
- either modify the Makefile
- or clear the memdebug.cpp
- or use the preprocessor condition:
      #if 0
        ...
      #endif
Now we are ready to start the build and installation:
dev# python setup.py build 
...
dev# python setup.py install --prefix=/mnt/C/sys/
...
If the build and installation succeeded, we are almost done. Now, when we try to start the deluge daemon, the dynamic loader is missing some symbols (it was same with previous version, I am possibly doing something wrong but do not know what).
dev# deluged
dev# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'
At least we have the workaround - library preload, with following triar and error method we get the set of libraries to be rpe-loaded:
dev# LD_PRELOAD=/usr/lib/libstdc++.so.6 deluged
dev# /usr/bin/python: can't resolve symbol 'BIO_free'

dev# LD_PRELOAD="/usr/lib/libstdc++.so.6 /usr/lib/libssl.so.0.9.7" deluged
dev# /usr/bin/python: can't resolve symbol '_ZN5boost6system18get_posix_categoryEv'

dev# LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged
OK, now it works. We can prepare the loader script with previous command-line:
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 
Now (if we have the /mnt/C/sys/bin in our PATH) we can run the deluge daemon as follows:
dev# deluged.sh
For deluge client the symbol problem is the same, so we prepare a loader script as well:
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 we try to launch the GUI (GTK client) but some problems still remain:
dev# deluge.sh
...
  File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.py", line 142, in get_logo
    size, size)
gobject.GError: Unrecognized image file format
We already solved this problem with previous version, so we know the receipt:
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.py
Let's try again:
dev# deluge.sh
...
  self.window.show()
/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/gtkui/mainwindow.py:95: GtkWarning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
  self.window.show()
Segmentation fault
We forgot the set up the DISPLAY environment variable properly (Actually I do not know why it crashes in such case, but the truth is that proper DISPLAY setup solves the problem):
dev# export DISPLAY=<x-server-ip>
One more thing we have to do is to let python know the path to the deluge egg:
dev# cd /mnt/C/sys/lib/python2.5/site-packages
dev# echo "./deluge-1.0.5-py2.5-linux-i686.egg" > deluge.pth 
Finally we are ready to create the deluge-1.0.5 package:
dev# cd /mnt/C
dev# ./filopack.sh --pack deluge-1.0.5

Remote install

Now we have the package created locally on the "mirror" system (colinux debian in my case). But we have to get it to the box. The filopack script can help us with this task as well.

First we have to uninstall the previous deluge version from the box. We can definitely do it locally on the box itself, but we can also do it remotely:
dev# ./filopack.sh -r --remove deluge-0.9.03
Configuration file .filopack/.config file found and used
Sure to remove deluge-0.9.03 remotely at root@storage:/mnt/C (y/n)?y
...
If we want to make sure that the previously installed software is gone, we can look at the package summary (unfortunately this feature is supported only locally). So from the box shell we can do following:
box# ./filopack.sh --summary
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)

Filodej package summary:
Package name                          downloaded [#installed/#total]
--------------------------------------------------------------------
Mesa-7.0.3                                no           [   0/  49]
MesaDemos-7.0.3                           no           [ 129/ 129]
atk-1.22.0                                no           [ 160/ 160]
audiofile-0.2.6                           no           [   0/  13]
binutils-2.18                             no           [ 140/ 140]
boost-1.35.0                              no           [5195/5195]
cairo-1.6.4                               no           [  76/  76]
code2html-0.9.1                           no           [   2/   2]
cvstrac-2.0.1-3                           no           [   3/   3]
dbus-1.2.1                                no           [  38/  38]
dbus-glib-0.76                            no           [  32/  32]
dbus-python-0.82.4                        no           [  66/  66]
deluge-0.9.03                        no          [   0/ 673]
didiwiki-0.5                              no           [   1/   1]
faad2-2.6.1                               no           [   0/   8]
...
Now we are back in the "mirror" system console and we can upload the (newly created) package to the box:
dev# ./filopack.sh -r --upload deluge-1.0.5 
Configuration file .filopack/.config file found and used
Sure to upload deluge-1.0.5 to root@storage:/mnt/C (y/n)?y
root@storage's password: 
deluge-1.0.5.tar.bz2                                                100%   15MB 318.3KB/s   00:48    
And perform the remote installation as well:
dev# ./filopack.sh -r --install deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
Module deluge-1.0.5 not found in package list - use 'tar.bz2' extension
Sure to unpack deluge-1.0.5 remotely at root@storage:/mnt/C (y/n)?y
root@storage's password: 
...
Deluge daemon (deluged.sh) now works OK on the box.

The only remaining problem is following. When we run the GTK GUI client (deluge.sh) we get following error:
box# deluge.sh
...
gobject.GError: Failed to open file '/tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png': No such file or directory
When we look to the /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/ directory there is not a inactive16.png there is just inactive16.png0000644 file and the same is with checking16.png file.
It seems it is a bug in tar implementation, the file permissions are "leaking out" to the name (see this issue description or this forum).

The solution is easy in this case:
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png{0000644,}
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/checking16.png{0000644,}
When you run the deluge and it looks similar like this: ... then there are some missing links to font directories:
box# mkdir /usr/share/fonts
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF
box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF

Setup

Now (after the update of the python package) we are able to run the console client right on the box: We can read the configuration options:
>  configs             

* add_paused: False
* allow_remote: False
* auto_managed: True
* autoadd_enable: False
* autoadd_location: C
* compact_allocation: False
* config_location: /mnt/C/sys/root/.config/deluge
...
* daemon_port: 58846
...
If we want access the daemon remotely, we can set it up as follows (of course it is possible to change the port as well):
> config-set allow_remote True

* Configuration value successfully updated.

>  quit 

Thanks
box#
Now we have to restart the daemon (if it is running):
box# killall deluged
box# deluged.sh
... and we are set up to access the daemon remotely (from PC running either Linux or Windows) as can be seen on following screenshots:
Deluge 1.0.5 GTK client
(running on WinXP) Deluge 1.0.5 GTK client
(running on Ubuntu 8.04)
That's all for now.

49 comments:

Anonymous said...

On my WMU-6500 client won't start with GTK GUI. All needed dependencies are installed, but client says "ImportError: No module named gtk".

filodej said...

You did not install any dependencies listed in the previous post, did you?

In case you do not really want to run GUI from the box and instead just run the daemon on the box and connect to it from a client running on PC then I believe the dependency list would be much shorter (I did install the GUI just as an experiment and thus do not know the actual dependencies just for the daemon).

In case you have no packages installed so far, I would really appreciate if you found out what dependencies are valid for daemon and what are valid just for GUI.

Thanks,
Filodej

Anonymous said...

Yes, all of them are installed and daemon up and running without any error. But client will work only with WebUI, no GTK GUI even through Xming on my Windows PC.
P.S. For installation on "clean" WMU (just after formatting) your list of dependencies are not full. At least 2 packages (glib and gcc) shall be installed to get daemon work.

Anonymous said...

In addition to that, I tried to download 'gcc' from you site but the files seems to be corrupted. Do you have nay ideas ?

below is a screen-shot from my machine:

$ tar xjvf gcc-4.1.2-sjlj.tar.bz2.tar
sys/bin/c++
sys/bin/cpp
sys/bin/g++
sys/bin/gcc
sys/bin/gccbug
sys/bin/gcov
sys/bin/i386-linux-uclibc-c++
sys/bin/i386-linux-uclibc-g++
sys/bin/i386-linux-uclibc-gcc
sys/bin/i386-linux-uclibc-gcc-4.1.2
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/README
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/float.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/iso646.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stdarg.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stdbool.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/stddef.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/varargs.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/mmintrin.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/mm3dnow.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/xmmintrin.h
sys/lib/gcc/i386-linux-uclibc/4.1.2/install-tools/include/emmintrin.h
tar: Decompression failed
tar: Unable to read all data
tar: Unable to read all data


regards,
Christos

Anonymous said...

oops...sorry file was corrupted during download - apologies.
Christos

filodej said...

Hello Christos,

I know the site with packages is slow and the gcc package is huge (~25MB). I have solved this issue and created the new package containing just the gcc libraries necessary for deluge.
More details about the package creation can be seen here.

I know you probably downloaded the whole gcc package already, so sorry for that.

Hope that the situation is now much better in this respect.

Regards,
Filodej

Anonymous said...

Dear Filodej,

in my previous post, I forgot to express my congrats for the excellent work that you have done in your blog - therefore, welldone!

Apart from that, I have tried to install Deluge in my WMU-6500FS following your instructions and I run into some problems, so I need ur help.

I have downloaded and installed the main deluge file and all of the listed dependencies (of this post - even for the GUI) but when I try to run deluged / deluged.sh I am getting the some error. Probably you might have an idea of what goes wrong...by looking at my console msgs below.

$ deluged.sh
/usr/bin/python: Can't resolve symbol '_Unwind_SjLj_Register'
$
$
$ deluged -d
[DEBUG ] 19:14:09 configmanager:44 ConfigManager started..
[INFO ] 19:14:09 daemon:44 Deluge daemon 1.0.5
[DEBUG ] 19:14:09 daemon:45 options: {'logfile': None, 'config': None, 'port': None, 'donot': True}
[DEBUG ] 19:14:09 daemon:46 args: []
/usr/bin/python: can't resolve symbol 'PyUnicodeUCS2_DecodeUTF8'
$

all the best,
Christos

Anonymous said...

... as for "_Unwind_SjLj_Register" issue I have downloaded and extracted all content of "gcc-4.1.2-sjlj.tar.bz2".

filodej said...

Hello Christos,

did you look at the Q&A section about the deluge-gcc-deplibs package?
When I uninstalled the gcc package then one of the implications was the unresolved symbol '_Unwind_SjLj_Register'. This symbol is defined in libgcc_s.so library which is part of the gcc-4.1.2-sjlj and now also the deluge-1.0.5-gcclibs package.

In case you have the whole gcc package installed, you should have now the libgcc_s.so library in your /mnt/C/sys/lib/ directory.

The problem is that there is also an old version of the libgcc_s.so (which is part of the gcc 3.x) in /lib/ directory. Unfortunately this older library has exactly the same version.
(For details about this gcc versioning issue you can see my previous post).

I would say that you are either missing the new version of the libgcc_s.so library on your system or your linker has a preference of /lib over /usr/lib => /mnt/C/sys/lib directory).

Please try to find out whether the library is actually present and if so then what one the dynamic linker is actually picking up. Following command should help:

LD_TRACE_LOADED_OBJECTS=1 deluged.sh

We can look at the 'PyUnicodeUCS2_DecodeUTF8' symbol later.

Regards,
Filodej

Anonymous said...

Dear Filodej,

Thank you for your concern. I had read the Q&A post and I had installed the "deluge-1.0.5-gcclibs" package. Though, as you though of, wrong libraries are read by the console !.


$ LD_TRACE_LOADED_OBJECTS=1 deluged.sh
libm.so.0 => /lib/libm.so.0 (0x40007000)
libcrypt.so.0 => /lib/libcrypt.so.0 (0x40015000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40029000)
libc.so.0 => /lib/libc.so.0 (0x40031000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
$


I have solved this by appending the required library to you .sh file (as you see in the console output below), but the problem that persists is the "PyUnicodeUCS2_DecodeUTF8" symbol.

$ deluged.sh
/usr/bin/python: Can't resolve symbol '_Unwind_SjLj_Register'
$
$
$ LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 /usr/lib/libgcc_s.so" deluged -d
[DEBUG ] 08:53:55 configmanager:44 ConfigManager started..
[INFO ] 08:53:55 daemon:44 Deluge daemon 1.0.5
[DEBUG ] 08:53:55 daemon:45 options: {'logfile': None, 'config': None, 'port': None, 'donot': True}
[DEBUG ] 08:53:55 daemon:46 args: []
/usr/bin/python: can't resolve symbol 'PyUnicodeUCS2_DecodeUTF8'
$


Look forward to hearing from you :-)

regards,
Christos

filodej said...

Hello again,
congratulations for sucessfully solving (or at least working around ;-) your first problem.

Regarding the current one, I have investigated it a little bit, but need your cooperation. Please, look at this post and let me know what the results are.

Hopefully then we get your installation working.

Regards,
Filodej

Anonymous said...

Dear Filodej,

you are right! I have followed your instructions and indeed this is the problem. I hope that the console output after executing strace commandes would be found usefull for you.
Here
is the complete output from executing strace, and here for the strace -f.

Thank you in advance, for helping me out :-) hope others will benefit as well.

Regards,
Christos

filodej said...

Hi Christos,

I hope I have good news for you.

Look here and let me know if it helps.

Regards,
Filodej

Christos Georgousopoulos said...

You are the man !

Congrats on the excellent support!!!. This was indeed the problem. To tell you the truth, cause I am sure that you've been wondering this is how it happended. Alomost 2 months ago I started experimenting with the Box. I still have limited Linux knowledge. I have been trying for a lot of days to setup transmission, without any success. Initially I have found Joker's site and from that site I found your post related to Deluge. I have been waiting for you in order to release this file, and when I show you post I when straight to your Blogg. I downloaded and installed Deluge but I though that all of the dependencies files where build inside that file. When I first run Deluged, I obviously got some errors and from the console I understood that I should install python. So, I downloaded python from Joker's site. Then...after having more errors, I read more carefully your post. You see I have been waiting to long for this and I acted flivorous. Of course I installed your version of Python on-top of Joker's but as you mentioned this caused problems.

To sum-up I suceeded running Deluged daemon!!!. Though, I am getting errors from executing Deluge without a UI. I will erase everything from my Box and re-install everything from your site and come back to you with the results....I hope (and I am sure) that everything will go smooth this time.

Thank you for you concern. You are a really smart, fast, good guy. Keep up the good work ! :-)

All the best,
Christos

Christos Georgousopoulos said...

Hello again,

I have erased everything from my box in order to perform a clean installation based on your instructions. Unfortunately, this didn't go as it was expected.

Initially I installed Deluge and all of the dependencies, apart from setuptools. This was due to the fact that I couldn't run python cause there was a library .so-something missing - unfortunately I did not write down the name.

In order to fix this (and hopefully it was fixed) I downloaded & installed Joker's "minimal-config" & "libs-essential".

Now when I run:
LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0 /usr/lib/libgcc_s.so" deluged -d

I am getting the following error:
/usr/bin/python: can't resolve symbol 'g_assertion_message_expr'

I haven't tried to install other files, since I do not know which ones are needed, and basically I need your advice on that. I believe that by trying to make Deluge work on a clean machine it will also (apart from me) help you to correct some of your instructions, cause I think that something is missing here (as the libs for tunning python, for instance).

PS: I've read an older post on where another guy was experiencing a similar problem, but you replied him that he should wait until you release this post.

regards,
Christos

filodej said...

Hello Christos,

I suppose I have found a solution for your problem, it is described
here in a detail.

Btw.: Thank you for giving me such a credit; I am glad there is someone patient like you, I hope we together create such a knowledge base that finally the installation won't be such painful experience like it is now for you ;-)

Regards,
Filodej

Nicholas said...

Hi Filodej,

Thanks for the release. I have been following the posts and I must say the support is great.

I noticed that Christos has a problem with running the console. I get this error too. The deamon runs. The client fails because it is missing the readline package. I located the package on the WMU-6500 and I preloaded it but then the problem shifts to an unresolved symbol "BC". I would stick to the WebUI but it is very slow and in a language I do not speak. Do you have any ideas?

Thank you in advance...

Nicholas

filodej said...

Hi Nicholas,
I did not use the console and so did not realize that the python readline package is missing.

The reason is that when I built python, I did not configure it in order to contain the package.

./configure --enable-readline

Hopefully I rebuild the python package and upload it tomorrow.

Regards,
Filodej

Christos Georgousopoulos said...

Dear Filodej,
I have reinstalled again your 'glib' package on-top and the problem was fixed, so now I am in the same position as Nikolas.

I will wait for you to release the new package of python that fixes the issue with the null UI, and then I will report back to you.

So, as I see it there are two ways to proceed, and since you are the boss here, you'll decide ;-)

(a) I can either erase everything from the box and start over from the beginning after you perform some enchantments on the uploaded files

(b) try new release of python and see what we do.

I have no problem to perform clean-installations until the int.guide is optimised, the point is if you are you willing to go on with this...? On the other hand, even if the guide is properly written, the question is what will it happen if in the future a new release of a package is installed on-top of existing files, will deluge run smoothly or will this cause any problems?

Awaiting for you expertise... ;-)

filodej said...

Hello Christos and Nocholas,

finally I managed to make both packages (new readline-5.2 and rebuilt python 2.5.2). It was not so smooth as I have thought, so sorry for the delay (if you are interested how it went look at this post).

Christos, I think that this time the clean installation will not be necessary. Since there is no file collision like in the case of glib (at least I do not know about such) the following procedure should be ok (in any case thank you for your offer):

1. Uninstall python package
$ cd /mnt/C
$ ./filopack.sh --remove python-2.5.2

2. Download the packages
$ ./filopack.sh --download readline-5.2
$ ./filopack.sh --download python-2.5.2

3. Install the packages
$ ./filopack.sh --install readline-5.2
$ ./filopack.sh --install python-2.5.2

Good luck, and let me know if anything goes wrong.

Regards,
Filodej

Christos Georgousopoulos said...

just P-E-R-F-E-C-T !!!

To be on the safe-side I have erased everything from the box, and following from the beginning your instructions I have managed to successfully install Deluge and run the UI (with no GUI) just fine !

Thank you so much for your efforts and assistance. You've done a great job ! :-)

All the best,
Christos

filodej said...

Hello Christos,
it is great to hear such good news. Thank you for assuring me that now the installation is possible even on a clear box. It is good to know.

One more thing, did you (and also Nicholas) considered the access from GTK client running on a remote machine? I find it extremely convenient and running smoothly. In comparison to it the null GUI is just a hair-shirt.

Here I have described the quick setup.

Kind regards,
Filodej

P.S.: enjoy the soft ;-)

Nicholas said...

Hi Filodej,

I just completed the installation and it works great. I did succeed in connecting to the daemon remotely through a thick (not the WebGUI) client from Vista and Ubuntu. The result was complete success.

Thank you Filodej for your time, effort and support,

Nicholas


PS For those who try to install the client in Ubuntu they should install the Hardy 1.0.6 client and not the Intrepid or the older client in the channel as the Intrepid comes up with a strange time library problem and the latter does not allow connecting to a remote daemon.

Christos Georgousopoulos said...

I am sorry for the delay, but yes I also confirm that I can access deluged from a thin client (as you describe in your post)

best regards,
Christos

Denier said...

Dear Christos, first of all many thanks for all your (and Filodej's) efforts. Now that you've become an expert in the WMU-6500FS, would you mind writing a tutorial on how to install Deluge from scratch for those who know even less about Linux than you? You could assume that Deluge is, pretty much, all I need to run on the box, and that I only need to access Deluge is via the daemon--so no GUI niceties needed on the box. What I need is to keep the C: drive from bloating.

(You may even find it fit to post your C: drive somewhere for scumbags :-) like me, though, again, I'd very much like to build a very minimal C:)

Many thanks again, and Kudos to Filodej.

Merry Christmas,

Aqualung

filodej said...

Hello Aqualung,

I have thought that now the resulting instructions are relatively straightforward. Please, do not be confused by the fact that I am also trying to describe the whole build process (since I think there can be someone who is - like me - learning Linux toolbox rather than just looking for a resulting installation).

However if you are still looking for something more explicit then there is a step-by-step cookbook written by Pelikan. I have come across it on a Russian forum. Unfortunately it is in Russian and my Russian is even (much) worse than my English :(
Maybe Mr. Pelikan (who was also active at this blog) could be so nice and translate it for us.

Regards,
Filodej

Denier said...

Dear Filodej, let me tell you what it is that I do/don't understand from your algorithm:

1. I take it that everything you listed under "Prerequisites" and "Dependencies" should be installed in the /mnt/C/ folder, right?

2. How about the "GUI dependencies"? Do I need to install those (awfully many) packages if I only need to access Deluge through the web interface?

3. Otherwise, would it be a problem if I downloaded all those packages in Windows, transferred them on the box using Windows Explorer, and then untar/unzip them there? Would that give me trouble? I find it awfully tedious to do all that file management stuff in command line... (Myeah, I'm one of those used to click their way to happiness, as they say.) (Note that the untarring will not be done in Windows, but on the box, so no need to worry here.)

4. Would I have to do any editing/configuration of the profile, env-ng and rc-local files in the etc folder? Or is it that whatever Joker chose as default should suffice?

5. The $64,000 question: the [setuptools] package listed under "Dependencies" is actually not a package at all, but a link to a website, titled "Trac 0.11rc1." I didn't really find a setuptools package there, although there is a code section titled setuptools. Should I understand that I am just supposed to run that piece of code? On the other hand, that very piece of code seems to have another heap of dependencies listed under "Dependencies" on that page ("subversion, python, apache & mod_python, SQLite"), and so on and so forth. Should I install those dependencies as well? ...after which I run that piece of code and get back to installing the rest of packages listed in the initial post.

6. Finally, as I was having trouble w/your filopack.sh script, should I understand that filopack.sh also requires some (if not all) the dependencies listed in the "Deluge part IV" posting? It could be that that's why it wasn't working for me, as I was running it without having installed those dependencies ...

Many thanks,

Aqualung

filodej said...

1) right

2) There should be no need for GUI dependencies unless you want to run gui directly on the box (I do not recommend it - it is relatively slow). However since I have all the dependencies installed, I am not 100% sure there isn't a package which is needed even for non-GUI mode. If it is the case, please, let me know and I correct the list.

3) It should cause no problem. If you find the console way (wget) does not make you happy (although in this particular case I really do NOT get it) you can download the files whenever you want (and click on them any times you need ;-). In the other hand (as you probably know) the untarring should take place on a linux system.

4) I do not know the exact state of your system, but:
a) make sure your executable path, library path and package paths are ok (not sure if the last one is necessary):

box# echo $LD_LIBRARY_PATH
:/mnt/C/sys/lib/:/mnt/C/sys/X11/lib/
box# echo $PATH
/usr/bin:/bin:/mnt/C/sys/X11/bin/
box# echo $PKG_CONFIG_PATH
:/mnt/C/sys/lib/pkgconfig/:/mnt/C/sys/X11/lib/pkgconfig/

... you can ignore the X11 paths if you are not going for the GUI on the box
b) I recommend you using the bash shell instead of ash
c) once you finish the installation you may want to run the deluged any time the box reboots
... maybe I forgot something, sorry for that

5) As I described here and also according to already mentioned Pelikan's post the following should be enough:

box# wget http://peak.telecommunity.com/dist/ez_setup.py
box# python ez_setup.py

... of course you need to have python interpreter already installed.

6) In your case the missing dependency is the bash shell interpreter (see this post).
Generally, for remote commands (definitely not needed here) there is a dependency on dropbear ssh client and maybe for some of the commands there can be dependencies to JoKeR's busybox extended (for info how to install it see my configuration post).

Hope this helps.
Filodej

Denier said...

Installed all prerequisites (not the dependencies though), but here's a new twist:

$ ./filopack.sh --download deluge-1.0.5
./filopack.sh: line 32: getopt: command not found
Internal error!

So it looks like filopack.sh requires further prerequisites, or that there's some configuration that's missing. (Note that both box# echo $LD_LIBRARY_PATH and box# echo $PKG_CONFIG_PATH give nothing, and I don't know how to set these variables. Googled them, but that got me even more confused.)

filodej said...

Hi,
I did not realize that getopt is not in basic busybox but is part of busybox extended. Now it is added to list of prerequisites.

Regarding to environment variables - export is what you are looking for. As is described here you can add something like:

export PATH=$PATH:/mnt/C/sys/X11/bin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/C/sys/lib/:/mnt/C/sys/X11/lib/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mnt/C/sys/lib/pkgconfig/:/mnt/C/sys/X11/lib/pkgconfig/

... to your /mnt/C/sys/etc/profile.

Filodej

Denier said...

Gosh, this filopack.sh script has been giving me only troubles. I wonder if there's any way to perform the last step (i.e. install deluge-1.0.5.tar.bz2) without running it, is there? Can I just untar the package normally as I did with all the other packages--that is, can I just put it in /mnt/C/ and untar it?

I had to download it manually (that is, w/o filopack), and here's what I got when running the script:

[Aqualung@Airlive2 C]$ ./filopack.sh --install deluge-1.0.5
Configuration file .filopack/.config file found and used
Retrieving package index... (Connecting to http://filodej.ic.cz)
./filopack.sh: line 302: [: tar.bz2: binary operator expected
unknown extension: tar.bz2 deluge-1.0.5-gcclibs:tar.bz2

There's obviously something rotten in that script when communicating with your server. Pelikan does make reference to something similar, but my Russian is no longer what it used to be :-) I can't really understand his workaround, and Google translation doesn't help much.

filodej said...

The filopack.sh script is fixed now.

You can download the new version or of course you can download and untar all the packages on your own.

Denier said...

"The filopack.sh script is fixed now."

Not yet. Here's what it downloaded: deluge-1.0.5:tar.bz2 (note the ":" character where "." was supposed to be).

filodej said...

Ooops, sorry.

Now it should (hopefully) be ok.

Denier said...

Alright, so far the whole Deluge affair didn't work for me (I assume that the WebUI should be accessed on port 8112 by default). But then, again, I did not install those (presumably unnecessary) GUI dependencies... Which may point to the fact that they are not so unnecessary after all. I'll give it a try tomorrow, this time after installing positively everything you've listed.

Many thanks for your assistance.

Anonymous said...

Hi there,
I made my way through this blog and got the daemon running. However, I also want to configure the client (mainly, to make it remotely accessible). I installed readline 5.2 and python as prescribed, but I still get the error message "IOError: No such file or directory", line 470 in file ".../ui/null/deluge_shell.py".
The error occurs apparently on "readline.read_init_file()".
Thanks!

filodej said...

Hi Thomas,
user Pelikan had the very same problem.

Make sure you are logged in as root:

box# whoami
root

... and make sure your home directory is
/mnt/C/sys/root:


box# echo $HOME
/mnt/C/sys/root

or:

box# cd ~
box# pwd
/mnt/C/sys/root

If not, you can move the
.inputrc
file to a proper directory:

box# mv /mnt/C/sys/root/.inputrc <your_home_dir>


Hope this helps,
Filodej

Anonymous said...

Thanks a lot! Copying the file into the correct root directory did the job! Sorry I did not read the Pelican blog.
Having everything set up, I was however somewhat disappointed to see that I cannot add any torrents or modify settings from within the (Windows) client connected to the daemon on the box. This is probably because of the heavy workload for the 486 CPU + 32 MB RAM in the box? Having a nice client which does not react to anything is not very useful after all this trouble... ;-)

filodej said...

Hi Thomas,
I do not know what you are running on the box, but I am using the windows client connected to the daemon running on the box quite happily.
Adding the torrents and modifying the options works for me with tolerable latency (it possibly depends on number of running connections, when nothing is downloaded sometimes the initial reaction is slow due to sleeping hard drive, but it does not count for me).
Deluged process consumes about 40-50% of box physical memory, then there is samba (3-5%) and httpd (~3%), I have still about 13MB of free memory when running the deluge daemon.
Try to more investigate what exactly causes such weird behavior in your case.
Regards,
Filodej

Anonymous said...

Can you post how you configured the client? It must be something other then ressource consumption, I checked with "top" in the box, lots of free memory & CPU. Actually deluged enters sleep mode after a while with hardly any CPU consumption at all.
Cheers, Thomas

filodej said...

box# deluge --ui=null
[INFO ] 15:49:10 main:93 Deluge ui 1.0.5
[DEBUG ] 15:49:10 main:94 options: {'config': None, 'logfile': None, 'ui': 'null'}
[DEBUG ] 15:49:10 main:95 args: []
[DEBUG ] 15:49:10 configmanager:44 ConfigManager started..
[INFO ] 15:49:10 main:98 Starting ui..
[DEBUG ] 15:49:10 ui:44 UI init..
[DEBUG ] 15:49:10 configmanager:88 Getting config 'ui.conf'
[DEBUG ] 15:49:10 config:47 Config created with filename: ui.conf
[DEBUG ] 15:49:10 config:48 Config defaults: {'default_ui': 'gtk'}
[INFO ] 15:49:10 ui:68 Starting NullUI..
[DEBUG ] 15:49:11 client:54 CoreProxy init..
Welcome to deluge-shell. Type 'help' to see a list of available commands.
> configs

* add_paused: False
* allow_remote: True
* auto_managed: True
* autoadd_enable: False
* autoadd_location: C
* compact_allocation: True
* config_location: /mnt/C/sys/root/.config/deluge
* copy_torrent_file: False
* daemon_port: 58846
* dht: True
* dont_count_slow_torrents: False
* download_location: torrentfiles
* enabled_plugins: []
* enc_in_policy: 1
* enc_level: 2
* enc_out_policy: 1
* enc_prefer_rc4: True
* ignore_limits_on_local_network: True
* info_sent: 0.0
* listen_ports: [6881, 6891]
* lsd: True
* max_active_downloading: 3
* max_active_limit: 8
* max_active_seeding: 5
* max_connections_global: -1
* max_connections_per_second: -1
* max_connections_per_torrent: -1
* max_download_speed: -1.0
* max_download_speed_per_torrent: -1
* max_half_open_connections: -1
* max_upload_slots_global: -1
* max_upload_slots_per_torrent: -1
* max_upload_speed: 5.0
* max_upload_speed_per_torrent: -1
* move_completed: False
* move_completed_path: C
* natpmp: True
* new_release_check: True
* plugins_location: /mnt/C/sys/root/.config/deluge/plugins
* prioritize_first_last_pieces: False
* queue_new_to_top: False
* random_port: True
* remove_seed_at_ratio: False
* seed_time_limit: 100.0
* seed_time_ratio_limit: 7.0
* send_info: False
* share_ratio_limit: 2.0
* state_location: /mnt/C/sys/root/.config/deluge/state
* stop_seed_at_ratio: False
* stop_seed_ratio: 2.0
* torrentfiles_location: torrentfiles
* upnp: True
* utpex: True

>

Anonymous said...

Thanks, I copied everything 1:1, but it is not working. It could be the windows client after all, I had to use the most recent version 1.10 RC2 because the previous versions did not run on win x64 - which is what I have.
Perhaps the 1.05 daemon does not work with the 1.10 client, who knows...

filodej said...

It could possibly be the case. I feel that at this Russian forum they have also some problems with version compatibility.

Do not know what you have tried. For any case here is the 1.0.5 version for windows (both 32 and 64 bit).

Regards,
Filodej

Anonymous said...

Meanwhile I have run a XP 32bit OS (from an old laptop) and tried to access the daemon from there (with Deluge 1.05 client). Now I can actually access on the Add-Torrent button (which was disabled in Vista x64, Deluge 1.10) and the client correctly displays the preferences entered in the ui console (also new). However, when I try to add a torrent, I can choose a torrent file, but then nothing happens. Back in the ui console, I can confirm the new torrents have not been accepted via the windows client.
Any ideas? I guess I will have to give up on this...

filodej said...

Try to run the daemon in foreground:

LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" deluged -d

In my case, when adding a fedora-fc4-i386 torrent the following is traced out on the console:

...
[DEBUG ] 19:41:01 torrentmanager:554 Saving torrent state file.
[DEBUG ] 19:41:54 signalmanager:52 Deregistering 192.168.1.101 as a signal reciever..
[DEBUG ] 19:41:57 signalmanager:61 Registering http://192.168.1.101:62413 as a signal reciever..
[DEBUG ] 19:41:57 core:934 new_release: 1.1.0_RC2
[DEBUG ] 19:44:31 torrentmanager:251 torrentmanager.add
[DEBUG ] 19:44:31 torrentmanager:313 options: {'max_download_speed_per_torrent': -1.0, 'add_paused': False, 'prioritize_first_last_pieces': False, 'max_upload_speed_per_torrent': -1.0, 'auto_managed': True, 'max_connections_per_torrent': -1, 'download_location': 'torrentfiles', 'compact_allocation': True, 'file_priorities': [1], 'default_private': False, 'max_upload_slots_per_torrent': -1}
[DEBUG ] 19:44:31 component:149 Pausing component AlertManager..
[DEBUG ] 19:44:31 torrentmanager:345 handle id: 920906fb8f6eb9f8bc5b141cf42834eeca105e5f
[DEBUG ] 19:44:31 torrent:54 Creating torrent object 920906fb8f6eb9f8bc5b141cf42834eeca105e5f
[DEBUG ] 19:44:31 configmanager:88 Getting config 'core.conf'
[DEBUG ] 19:44:31 torrent:197 setting file priority with compact allocation does not work!
[DEBUG ] 19:44:31 torrent:257 set_state_based_on_ltstate: 3
[DEBUG ] 19:44:31 torrent:141 Torrent object created.
[DEBUG ] 19:44:31 component:159 Resuming component AlertManager..
[DEBUG ] 19:44:31 alertmanager:101 state_changed_alert: fedora-fc4-i386.zip: state changed to: downloading
[DEBUG ] 19:44:31 alertmanager:101 torrent_checked_alert: fedora-fc4-i386.zip checked
[DEBUG ] 19:44:32 torrentmanager:554 Saving torrent state file.
[DEBUG ] 19:44:32 pluginmanager:132 run_post_torrent_add
[DEBUG ] 19:44:32 alertmanager:101 torrent_resumed_alert: fedora-fc4-i386.zip resumed
[DEBUG ] 19:44:32 alertmanager:101 tracker_announce_alert: fedora-fc4-i386.zip (http://tracker.thoughtpolice.co.uk:6969/announce) sending announce (started)
[DEBUG ] 19:44:32 alertmanager:101 tracker_reply_alert: fedora-fc4-i386.zip (http://tracker.thoughtpolice.co.uk:6969/announce) received peers: 2
[DEBUG ] 19:44:32 torrentmanager:745 on_alert_state_changed
[DEBUG ] 19:44:32 torrent:257 set_state_based_on_ltstate: 3
[DEBUG ] 19:44:32 torrentmanager:657 on_alert_torrent_checked
[DEBUG ] 19:44:32 torrent:257 set_state_based_on_ltstate: 3
[DEBUG ] 19:44:32 torrentmanager:739 on_alert_torrent_resumed
[DEBUG ] 19:44:32 torrent:257 set_state_based_on_ltstate: 3
[DEBUG ] 19:44:32 torrentmanager:681 on_alert_tracker_announce
[DEBUG ] 19:44:32 torrentmanager:664 on_alert_tracker_reply
[DEBUG ] 19:44:33 alertmanager:101 scrape_reply_alert: fedora-fc4-i386.zip (http://tracker.thoughtpolice.co.uk:6969/announce) scrape reply: 1 8
...

Hopefully you will see an error indication in your log.

Filodej

Anonymous said...

Hi there,
I figured it out! After having added the packages pycairo and pygtk on the box, the windows client worked! Which of the two packages is necessary (or both) I don't know. But that seemed to have made the difference.
Thanks for the support, I am very happy now! :-)
Cheers, Thomas

Denier said...

Greetings.

Just in case you missed it, Deluge 1.1.0 final is out.

Cheers,

Aqualung

Hurricane Hunia said...

Hi Filodej, just want to say you have done a great job with this, much applause. Ive got an issue with my torrents bugging out with 'No space left on device' which is baffling as i have 700gig available. I thought maybe changing the default download folder may have buggered me up, can you tell me what it is supposed to be? Or any other ideas what might be causing this? Im not a linux person so im stumped.

My current download location is /mnt/C/sys/incomplete

Thanks

filodej said...

Hi,
thanks for the appreciation.

Can you, please, run the df command from the console? (just to make sure everything is properly mounted and all partitions have enough space).

Following table is output in my case:

box# /bin/df -h
Filesystem Size Used Available Use% Mounted on
/dev/rom0 2.6M 2.6M 0 100% /
tmpfs 14.7M 496.0k 14.2M 3% /tmp
/dev/hdc1 136.9G 7.1G 129.8G 5% /tmp/mnt/C
/dev/hdc2 9.7G 4.4G 5.3G 46% /tmp/mnt/D
/dev/hdc1 136.9G 7.1G 129.8G 5% /tmp/share/Public
...

Note that I used /bin/df instead of simple df because my busybox version installed in /usr/bin did not work. If that is your case as well, you better fix it by removing the busybox's df symlink:

box# ls -l /usr/bin/df
lrwxrwxrwx 1 root root 8 2009-06-09 15:16 /usr/bin/df -> busybox2
box# rm /usr/bin/df


When I start deluge console and retrieve config I get the following:

box# deluge
>>> config
...
* download_location: /mnt/C/torrentfiles
...
* torrentfiles_location: /mnt/C/torrentfiles
...

So far I have no idea what is wrong in your case, drop here the output of the commands and we'll hopefully see more.

Regards,
Filodej