Mldonkey - multi-network file-sharing client
Originally by marge and frontalot from linkstationwiki.org
![]() |
Contents
Background
MLDonkey[1] is an open source, free software multi-network peer-to-peer application that supports the BitTorrent protocol[2] . It is also the name of the peer-to-peer overlay network that application uses. Originally a Linux client for the eDonkey protocol[3] MLdonkey is written in the Ocaml programming language and licensed under the GPL. The application separates the user interface (which can be a web browser, telnet, or a third-party GUI application)[4] and the code that interacts with the peer-to-peer networks[5][6][7].
MLDonkey supports the following network protocols, either partially or completely:
Installation
Unstable
ARM9
MLdonkey is reported to run well and stable on ARM9 boxes. Only emule sui feature has to be disabled cause mldonkey's implementation needs a real FPU which is not present in SoftARM Linkstations. Precompiled mldonkey cores for ARM architectures are avaiable for download:http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4825 Cores are compiled on Debian Linux. There are possible issues about DNS resolutions or library version problems(Linkstations have modified version of libc which could cause incompatibility). In order to solve these issues the cores are bundled with the exact shared libraries (zipped in archive) and libc version used to compile the cores. FIRST SOLUTION(easy)The Library problem (if arises) has an easy solution, let's put the bundled libraries in a proper directory ("/new_libs_path" in this example) and call mlnet thru next script. For example Georg wrote following three liner scripts:
LD_LIBRARY_PATH=/new_libs_path:$LD_LIBRARY_PATH export LD_LIBRARY_PATH /path_to_mldonkey/mlnet.static
$ LD_LIBRARY_PATH=/new_libs_path:$LD_LIBRARY_PATH ./mldonkey_path/mlnet (arguments?)
SECOND SOLUTION (CHROOT MLNET)A more complex solution is to "chroot" mldonkey.This is also a feature suggested to raise system security but this is quite difficult to set. Togeis has wrote a spledid walkthru: This is a little howto running mldonkey on a opend Stock firmware. I am using 1.11-1.a. All steps are done as root user. 1) Make a new mldonkey User: If /mnt/disk1/home doesn't exist, make it: mkdir /mnt/disk1/home Adding user: useradd -d /mnt/disk1/home/mldonkey -m mldonkey I used a homedir an disk1 to prevent filling up / 2) Getting UID of created user: grep mldonkey /etc/passwd|cut -d ":" -f3 1000 Now you have the UID you can use for starting mldonkey 3) Setting up chroot: - Make /dev/null and /dev/random mkdir /mnt/disk1/home/mldonkey/dev mknod /mnt/disk1/home/mldonkey/dev/null c 1 3 mknod /mnt/disk1/home/mldonkey/dev/urandom c 1 9 - Copy Libs: Use the libraries tarfile from fabtar cp libraries.tar.bz2 /mnt/disk1/home/mldonkey cd /mnt/disk1/home/mldonkey tar -jxvf libraries.tar.bz2 - Make ./etc mkdir /mnt/disk1/home/mldonkey/etc cp /etc/group /etc/hosts/ /etc/nsswitch.conf /etc/passwd /etc/resolv.conf /mnt/disk1/home/mldonkey/etc
incoming_directory = incoming temp_directory = temp shared_directories = [ shared1; shared2; shared3] run_as_user = "" Starting with a fresh install: I use the static build with gd support from fabtars tarfile. cp mldonkey-2.9.0.CVS.static.arm-Linux_glibc-2.3.6.tar.bz2 /mnt/disk1/home/mldonkey cd /mnt/disk1/home/mldonkey; tar -xjvf mldonkey-2.9.0.CVS.static.arm-Linux_glibc-2.3.6.tar.bz2 mv ./mldonkey-distrib-2.9.0.CVS/* . rm ./mldonkey-distrib-2.9.0.CVS
chown -R mldonkey:mldonkey /mnt/disk1/home/mldonkey chown -R root:root /mnt/disk1/home/mldonkey/lib /mnt/disk1/home/mldonkey/etc /mnt/disk1/home/mldonkey/dev mldonkey is the user created at step 1. The user has its own group named the same. 6) Staring mldonkey with chroot Be sure you are root: id getting --> uid=0(root) gid=0(root) Setting enviroment: export MLDONKEY_CHROOT=/home/mldonkey Starting mldonkey: cd /mnt/disk1/home/mldonkey ./mlnet -run_as_useruid 1000
7) Starting mldonkey with nohup (detach mldonkey from the console) - Install nohup if it doesn't exist: When you use a opend Stock firmware with wget installed, you don't have nohup, but you can install it by yourself. Get the file coreutils-6.7-r1.tbz2 cd /tmp wget http://downloads.nas-central.org/LSPro_ARM9/Distributions/Genlink/Binaries/armv5tejl-softfloat-linux-gnueabi/coreutils-6.7-r1.tbz2 tar -C / -xjvf coreutils-6.7-r1.tbz2 ./usr/bin/nohup - Starting mldonkey as root cd ~mldonkdey nohup ./mlnet -run_as_useruid 1000 & Now you are able to close the terminal and mldonkey keeps on running. Output created by mldonkey is written to ./nohup NOTES: Mindbender has pointed that overmentioned solutions are inelegant. You may consider to use this startup script: http://www.unet.univie.ac.at/~a0025690/scripts/mldonkey Someone told me that they had problems because su was missing. in case that is true for the arm9-boxes as well then we can just remove that command and just use the built in mldonkey thing you used. if su is missing replace this line su - $USER -c"/usr/local/bin/mlnet&" with either /usr/local/bin/mlnet -run_as_useruid 1000 & if you start it automatically at bootup from /etc/init.d/rcS by adding echo "exec_sh mldonkey" >> /etc/init.d/rcS then you do not need to install nohup btw. In case you are a script-guru, I suggest to mix the mindbender suggestions with the tricks about Library problems. PowerPC(PPC) and MIPSELOver mentioned methods could be also applied on these archiectures please test and report about on software forums. PowerPC and MIPSEL Precompiled cores are aviable:PPC: http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834 Mipsel: http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890 PPC cores are reported to work to other NAS, no positive feedback about Linkstation PPC users.
|
|
FreeLink
You may need to use the Unstable (Debian) branch:
- Get access to packages from the Debian unstable branch
- Then install mldonkey by
apt-get install mldonkey-server
PPC and MIPSel
apt-get
apt-get update # update APT-Repository apt-get install mldonkey-server # install MLDonkey
Upgrading installed apt-get version
NOTE: This method ONLY tested by fcisler on his LSpro. Please provide feedback!!
The version apt-get will install is 2.8.1. I have had problems that after about two weeks or several gigs, it will crash. I have compiled 2.8.3 static (latest at time of writing, 3.15.07), so it should work standalone. For ease of use, and startup scripts - i install is via apt-get, and then upgrade it. After following the procedure above, use this:
#make sure mldonky is stopped /etc/init.d/mldonkey-server stop cd /usr/bin/ mv mlnet mlnet.PKG wget http://www.cisler.net/lspro/mldonkey/mlnet.static mv mlnet.static mlnet #start mldonkey /etc/init.d/mldonkey-server start
A ps-ax | grep mlnet should show at least one process running.
Please report success/failure in the forums. - fcisler
compile latest SVN
If you would like to have the latest SVN-Version (better speed etc.) then you should do the following steps. But be careful: Currently the latest SVN-Version is very unstable on the ARM-System. It'll freeze after a few minutes. There's a patch (svn.debian.org [1]) which should fix the problem but i didn't have success, it's still unstable.
cd /mnt/disk1/share/source/ apt-get install ssh cvs patch autoconf gcc g++ libc-dev make zlib1g-dev libbz2-dev libgd2-noxpm-dev cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/mldonkey co -P mldonkey cd mldonkey ./configure make cp ./mlnet /root/.mldonkey/
Problems (both ways)
There are problems within the ARM9-Version. After some starts the mlnet-Service will shut down automatically with an errormessage. The Problem is caused by a file called mlnet_strings.EN_ANSI_X3.4-1968. I've found a workaround: You have to delete the file before mlnet starts. Mlnet will create the file as soon as it is started.
I've created a file called run_mldonkey in the mldonkey-dir (/root/.mldonkey/):
#! /bin/sh # cd /root/.mldonkey/ rm /root/.mldonkey/mlnet_strings.EN_ANSI_X3.4-1968 mlnet > /dev/null 2>&1 &
After that i have created a symbolic link within the /etc/rc2.d-Directory to get it automatically started. First tests were successfully, mldonkey seems to run stable
OpenLink
PowerPC
This project aims to offer the latest MLDonkey P2P client and additional utilities precompiled and packaged for the PPC LinkStation. This release is compiled without GUI support. See http://www.nongnu.org/mldonkey/ for more information. You may download the latest version from the downloads area.
ppc-mldonkey-2.5.30.16–1
- mldonkey-2.5.30.16
- ed2k_hash
- make_torrent
A newer version of mldonkey, MLNet 2.8.1, compiled for a KuroBox Pro (PPC) is available at: http://cisler.net/kuro/mlnet/mlnet-2.8.1.tar.gz
If someone could please host this (bandwidth is limited), contact me on the site - fcisler
MIPSel
Older binaries + packages are available here. But there was feedback that they did no work properly because of the missing libmagic. So you would have to install the development tools which should fix this dependancy.
mkdir /mnt/hda/temp cd /mnt/hda/temp wget http://www.unet.univie.ac.at/~a0025690/mips-binaries/mldonkey_mips-2.7.6.tar.gz tar -xzvf mldonkey_mips-2.7.6.tar.gz ./install.sh
Compile from Source
You can find the latest sources of mldonkey at the mldonkey project at sourceforge. First install the development tools.
- Precompiled C development environment, running on the LS
- Then mldonkey can be compiled by:
wget http://easynews.dl.sourceforge.net/sourceforge/mldonkey/mldonkey-2.8.4.tar.bz2 tar -xjf mldonkey-*.tar.bz2 cd mldonkey-* ./configure --enable-batch --disable-gui make make install
mldonkey version 2.8.4 compiled onto the following way (By HomeBunny - April 2007):
cd /mnt/misc wget http://dfn.dl.sourceforge.net/sourceforge/mldonkey/mldonkey-2.8.4.tar.bz2 bunzip2 mldonkey-2.8.4.tar.bz2 tar xvf mldonkey-2.8.4.tar cd mldonkey-2.8.4 ./configure --enable-batch --disable-guia make make install WHEN YOU HAVE THIS PROBLEM: [[NOT ENOUGH FREE SPACE]] ONTO \root\.mldonkey SOLUTION : Move your installation to \mnt\share mkdir /mnt/share/.mldonkey cp -Rdp /root/.mldonkey /mnt/share/.mldonkey rm -R /root/.mldonkey ln - s /mnt/share/.mldonkey /root/.mldonkey DON'T FORGET TO CHANGE THE Startscript: INSTALLEDPATH=/mnt/share/.mldonkey
you will need a startscript (/etc/init.d/mldonkey) for mldonkey.
#! /bin/sh export USER="root" NAME=mldonkey INSTALLEDPATH=/$USER/.mldonkey start() { su - $USER -c"/usr/local/bin/mlnet&" } stop() { su - $USER -c"kill -15 `cat $INSTALLEDPATH/mlnet.pid`" su - $USER -c"sleep 5" } case "$1" in start) echo -n "Starting mldonkey: " start ;; stop) echo -n "Stopping mldonkey " stop ;; restart) echo -n "Restarting mldonkey " stop start ;; force) echo -n "Forcing start of mldonkey " rm $INSTALLEDPATH/config_files_space.tmp rm $INSTALLEDPATH/mlnet.pid start ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|force}" exit 1 ;; esac exit 0
you can download it directly from here here.
cd /etc/init.d wget http://www.unet.univie.ac.at/~a0025690/scripts/mldonkey chmod 755 mldonkey
Additional Info
mldonkey should be runnable now by executing
/etc/init.d/mldonkey start
I had to add .sh That is what I use:
/etc/init.d/mldonkey.sh start
if you want mldonkey to be started automatically at startup:
FreeLink
ln -s /etc/init.d/mldonkey /etc/rc2.d/S99mldonkey
OpenLink
ln -s /etc/init.d/mldonkey /etc/rc.d/rc2.d/S99mldonkey
References
- ↑ Wikipedia: MLDonkey
- ↑ Comparison of BitTorrent software
- ↑ Comparison of eDonkey software
- ↑ Sancho (n): the premier graphical user interface for p2p cores
- ↑ MLDonkey/Mulus File Archive
- ↑ The official MLDonkey Community and News page
- ↑ MLDonkey Project Wiki - the Official Wiki of MLDonkey