Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Running azureus as p2p user, just like mldonkey
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
numlock
n00b
n00b


Joined: 17 Sep 2004
Posts: 50

PostPosted: Sat Jul 29, 2006 10:55 pm    Post subject: [HOWTO] Running azureus as p2p user, just like mldonkey Reply with quote

IMHO it's always a good thing to isolate p2p network traffic from "regular" user network traffic, because it allows to use iptables rules to filter/shape/block it by UID very easily !

Yes, mldonkey runs as p2p user, but unfortunately, the Azureus bittorrent client doesn't.

Here's how to do it:

(Edit) see below for best, updated method

It works great for me, and (IMHO) it's well worth doing !!

Please tell your opinions about this...


Last edited by numlock on Fri Aug 04, 2006 12:57 pm; edited 2 times in total
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Sun Jul 30, 2006 7:34 am    Post subject: Reply with quote

Moved from Networking & Security to Documentation, Tips & Tricks.
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 817
Location: PL

PostPosted: Tue Aug 01, 2006 12:55 pm    Post subject: Reply with quote

actually you can use azureus entirely without X. you need to install the swing-ui plugin for it, and then start azureus via
Code:
java -jar /path/to/Azureus2.jar --ui=console


you will need to install and copy a couple of java libraries into the directory where Azureus2.jar is. the errors will hint you (that's the way i figured it out) . (it was mentioned somewhere on the forums).

so i guess it's possible to combine it with your method and have azureus as a regular daemon which you can connect to via web interface ( http://localhost:6883 )

ps. i'm not sure whether azureus-bin works with it, i just tried azureus package.
_________________
~amd64, ~x86
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
numlock
n00b
n00b


Joined: 17 Sep 2004
Posts: 50

PostPosted: Wed Aug 02, 2006 11:25 pm    Post subject: Reply with quote

Mmh.. sounds nice, I will try that swing-ui plugin - thanks !

In the meantime, some improvements:

(Edit) removed -- see updated method below

No manual sudo needed anymore :D


Last edited by numlock on Fri Aug 04, 2006 12:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 817
Location: PL

PostPosted: Thu Aug 03, 2006 7:39 am    Post subject: Reply with quote

okay, this plugin is called "swing web interface". there are also different plugins, like telnet access, or html web ui for azureus. i didn't try them yet.

the drawback is that the swingweb needs a browser with java, because it launches an applet.

maybe the php interface, or telnet one would be more convenient here, so that the user would not need to run X just to add some downloads. [well, you can always configure azureus to watch a specific directory for torrents to do that]
_________________
~amd64, ~x86
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
numlock
n00b
n00b


Joined: 17 Sep 2004
Posts: 50

PostPosted: Thu Aug 03, 2006 9:02 pm    Post subject: Reply with quote

Here's a new version !

The "xhost LOCAL:" is not needed anymore, because we now use proper X11 authentication :D
Now only the p2p user (ie: Azureus) can interact with your X11 session. Other local users cannot, and that's much better.

Here it goes: (steps 1-3 must be done as root)

1 - Create a file named "/home/p2p/run-azureus" with the following contents:
Code:
#!/bin/bash
if [ -z "$1" ]; then
        xauth extract - $DISPLAY | sudo -H -u p2p "$0" $DISPLAY
else
        xauth merge - && ( DISPLAY=$1 nice -n15 /usr/bin/azureus & )
fi

The "nice -n15" will start Azureus at lowest priority. Remove it if you don't want it.

2. Protect that script by doing:
Code:
chown p2p:users /home/p2p/run-azureus
chmod 550 /home/p2p/run-azureus


3. Do "emerge sudo" then add this line to /etc/sudoers:
Code:
my_user_name            ALL=(p2p) NOPASSWD: /home/p2p/run-azureus

This allows your user to start azureus as the p2p user (ie: just as if you were the p2p user).
Of course, replace my_user_name with your regular user name.


4. Simply launch Azureus as regular user, by using the command (in Konsole or KDE shortcut):
Code:
/home/p2p/run-azureus


Ain't it great ? :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum