Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Wed Apr 23, 2014 7:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Fri Sep 14, 2007 6:58 am 
Offline
Newbie

Joined: Sun Aug 19, 2007 3:58 pm
Posts: 22
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:
Code:
mkdir /mnt/disk1/home

Adding user:
Code:
useradd -d /mnt/disk1/home/mldonkey -m mldonkey

I used a homedir an disk1 to prevent filling up /

2) Getting UID of created user:
Code:
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
Code:
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
Code:
 cp libraries.tar.bz2 /mnt/disk1/home/mldonkey
cd /mnt/disk1/home/mldonkey
tar -jxvf libraries.tar.bz2

- Make ./etc
Code:
mkdir /mnt/disk1/home/mldonkey/etc
cp /etc/group /etc/hosts/ /etc/nsswitch.conf /etc/passwd /etc/resolv.conf /mnt/disk1/home/mldonkey/etc


4) Copy MLDonkey:
Started mldonkey before:
- You have to copy the existing directory form the old mldonkey directory to the new home directory /mnt/disk1/home/mldonkey
- Edit your downloads.ini for the new root:
Code:
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.
Code:
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


5) Setting up ownership
Code:
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:
Code:
id
getting --> uid=0(root) gid=0(root)

Setting enviroment:
Code:
export MLDONKEY_CHROOT=/home/mldonkey

Starting mldonkey:
Code:
cd /mnt/disk1/home/mldonkey
./mlnet -run_as_useruid 1000


1000 is the UID of the user mldonkey you get it in step 2

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
Code:
cd /tmp
wget http://buffalo.nas-central.org/download/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
Code:
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


These steps helped me getting mldonkey started.

Ciao
Togeis


Top
 Profile  
 
PostPosted: Fri Sep 14, 2007 9:17 am 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
Great! I have linked your chroot walkthru from mldonkey's thread.
As soon as I have verified reliablity about POwerPC and Mipsel(I'm going to compile mipsel cores too) cores, I'll collect all this information in a wiki somewhere..

@Georg
Upload speed is also important for Bittorrent performances, looking at uploads you can see that bandwith is shared between ed2k and BT donwloads(If you have used ed2k too), you have to set a resonable upload speed and the number of global upload slots(users you upload at same time).
Bittorrent plugin has its own option in order to set the maximum number of those slots which could be used for BT uploads.
Example:I have 5 upload slots, and maximum 3 slots could be used for BT uploads.
Another detail, if you set a mldonkey's upload speed lesser than 10Kbyte/sec the download speed is bounded at Upload_speed*4 Kbyte/sec.This is emule behaviour too and is intended to reduce leeching.
Example: Upload=5KByte/sec ; Download is limited at 20Kbyte/sec

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Fri Sep 14, 2007 11:07 am 
Offline
Site Admin
User avatar

Joined: Mon Jul 11, 2005 7:19 am
Posts: 7702
Location: Austria, Vienna
ok, running mldonkey that way is more than inconvenient.

i wrote this scripts a while ago for running mldonkey on my LS1.

http://www.unet.univie.ac.at/~a0025690/scripts/mldonkey

some 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
Code:
su - $USER -c"/usr/local/bin/mlnet&"

with either
Code:
/usr/local/bin/mlnet -run_as_useruid 1000 &


if you start it automatically at bootup from /etc/init.d/rcS by adding
Code:
echo "exec_sh mldonkey" >> /etc/init.d/rcS

then you do not need to install nohup btw.

all together this info should go to
http://buffalo.nas-central.org/index.php/Ml ... lient#ARM9

_________________
LS1 (2.6 kernel, foonas svn1062, 750 GB, UBoot 1.2) & LS Pro (FreeLink/jtymod/GenLink, changes all the time)
Thx to all donators!


Top
 Profile  
 
PostPosted: Fri Sep 14, 2007 7:41 pm 
Offline
Developer

Joined: Wed Oct 25, 2006 6:05 pm
Posts: 613
Location: Germany
@fabtar, my limits were D 200 kB/s, U 15 kB/s. While the max download speed I observed was at 15 kB/s upload never exceeded 5 kB/s with system load above 90%. For comparsion rtorrent gave me D 80, U 6 (both limited at these values) with a system load well below 10%, usually even below 5%.
mindbenders suggestion regarding an arm9-related bug might be correct. When I paused the download the load dropped but still jumped around between 30-70% sometimes still reaching more than 90% - that didn't change even about 1/2 - 1 hour after I paused the download... :!:

Don't know if it's my configuration as I've the build tools on the "developer" and I've compiled a couple of libraries (zlib, openssl...) that might be accessed by mlnet (despite using mlnet.static).
So maybe someone else could verify my observations :?:

_________________
acp_commander users note: from ver. 0.4 on the correct ACP authentication method is used, avoiding possible side effects.
Download: http://sourceforge.net/project/showfile ... _id=167037


Top
 Profile  
 
PostPosted: Fri Sep 14, 2007 8:15 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
@Georg
The BT cpu consuption is a known issue that sometimes(quantisitic :biglol: ) arises on all platforms.The guys having this problem solves with:
share_scan_interval = 0

And sometimes disabling Geoip database or Ipfilter could help.

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Sat Sep 15, 2007 3:55 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
@Georg
I like to propose you another experiment:
Please test this otion/value:
download_sample_size = 10
(I always suggest share_scan_interval=0)
Is this helpful in reducing bittorrent CPU usage?

This could be useful to improve mldonkey:
http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26980#26980

You could try disabling Ipfilter blocklist also.

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Fri Sep 21, 2007 10:07 pm 
Offline
Developer

Joined: Wed Oct 25, 2006 6:05 pm
Posts: 613
Location: Germany
@fabtar, I did another test run with

download_sample_size = 10
share_scan_interval = 0

Maybe the cpu usage came down a bit, but that's definitely no breakthrough. If I find the time I shell try your other suggestions. Again the question to someone else to repeat the testing for comparison as the development system I use is sort of tweaked. ;)

_________________
acp_commander users note: from ver. 0.4 on the correct ACP authentication method is used, avoiding possible side effects.
Download: http://sourceforge.net/project/showfile ... _id=167037


Top
 Profile  
 
PostPosted: Thu Sep 27, 2007 8:43 am 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
mindbender wrote:


@all
I have modified the wiki, I have no experience in wiki editing, so please take a look and contribuite (add needed infos, references, fix editing, improve and give feedback as usual)

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Mon Oct 22, 2007 7:08 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
updated

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Thu Jan 31, 2008 8:56 pm 
Offline
Newbie

Joined: Mon Jul 09, 2007 5:40 am
Posts: 25
Location: Québec
First off, thanks for the precompiled binaries. I have a few questions though...

I use the PPC binaries on my LS1 with Freelink and webinstaller's kernel 2.6. I religiously follow all the instructions on togeis post but then, I get confused with mindbender's post saying it is better to launch mldonkey with a script.

Do I have to go through step 1 to 5 then skip steps 6 and 7 to use minderbender's script?

And I think the script has to be modified, right? I mean at least changing /usr/local/bin/mlnet to /mnt/disk1/home/mldonkey/mlnet according to togeis instructions, isn't it?

Another question, I thought the point of chrooting a process was to avoid running it as root. Am I wrong? So do I have to replace export USER="root" with export USER="mldonkey"?

Sorry if I'm completely out of the track. It works the way I configured it now but it's just that I'm not sure if my chroot is totally secured and I don't want to expose my box to any risk when mldonkey will be running.

Can anybody help me understand better? Or somebody have a definitive script that would allow me to launch mldonkey chrooted without any risk?

Thanks for your help.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2008 6:57 pm 
Offline
Site Admin
User avatar

Joined: Sun Jul 17, 2005 4:34 pm
Posts: 5330
Location: Cologne, Germany
Do you actually have a user "mldonkey"? If so, you need to modify

http://www.unet.univie.ac.at/~a0025690/scripts/mldonkey

's variables $USER, $INSTALLEDPATH, and the path to the mldonkey binary just as you said. Obviously, all these resources must be accessible.

_________________
HG · Debian squeeze
Linux Kernel 2.6/PPC (and more!) for Linkstation/KuroBox/HG/HS/Terastation from http://hvkls.dyndns.org


Top
 Profile  
 
PostPosted: Sat Feb 02, 2008 8:46 pm 
Offline
Newbie

Joined: Mon Jul 09, 2007 5:40 am
Posts: 25
Location: Québec
Thanks andre. Yes, I created a mldonkey user just like in the walkthrough. So as I understand, the script replaces steps 6 and 7, right?

If I ask, it is because I had a general crash of my system while downloading torrents and I thought it might have been because mldonkey was not configured properly. Some folders and files were inaccessible and they gave me input/output errors. I ran fsck.ext3 and I managed to recover everything, then I did a zero fromat with Samsung's utility that told me my hdd was still ok. After, I reinstalled the Freelink with uboot. Now the LS1 is back online but I was afraid of a security risk.

Is there anything I can do to verify that my chroot is set up properly?

Thank you!


Top
 Profile  
 
PostPosted: Wed Feb 06, 2008 4:30 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
updated 2.9.3 cvs

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Fri Feb 29, 2008 12:11 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
panchito wrote:
First off, thanks for the precompiled binaries. I have a few questions though...

I use the PPC binaries on my LS1 with Freelink and webinstaller's kernel 2.6. I religiously follow all the instructions on togeis post but then, I get confused with mindbender's post saying it is better to launch mldonkey with a script.
..
Thanks for your help.


Sorry for delay.
You can choose a chroot solution (togeis) or simply create a user for mldonkey sake and execute mldonkey using that user.
With the second way, when/if DNS-library problems arises you can use the bundled libraries launching mlnet thru a simple script which force the usage of my libraries.
more info about ARM:
http://mldonkey.sourceforge.net/forums/ ... php?t=4825
a bunch of info about PPC:
http://mldonkey.sourceforge.net/forums/ ... php?t=4834

There is a PPC thread in this forum too:
viewtopic.php?f=9&t=3719
a bunch of info:
http://buffalo.nas-central.org/index.ph ... tarball.29

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
PostPosted: Wed Mar 05, 2008 9:20 pm 
Offline
Newbie
User avatar

Joined: Fri Jun 01, 2007 10:29 am
Posts: 55
updated

_________________
Precompiled Debian Mldonkey's cores
ARM http://mldonkey.sourceforge.net/forums/viewtopic.php?p=26582#26582
PowerPC http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4834
Mipsel http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4890


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Protected by Anti-Spam ACP
Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group