Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

How to: Dapper and Starting MLDonkey: mlnet file[s] not owned by user 113 or group 1001: /var/run — reown it first

Posted by chantra on April 3rd, 2006

Today, when I wanted to start my mldonkey-server from command line, the service reported

Starting MLDonkey: mlnet file[s] not owned by user 113 or group 1001: /var/run -- reown it first

I've submitted a bug report, but before it gets fixed, here is a workaround.

Today, when I wanted to start my mldonkey-server from command line, the service reported

Starting MLDonkey: mlnet file[s] not owned by user 113 or group 1001: /var/run -- reown it first

I've submitted a bug report, but before it gets fixed, here is a workaround.

mldonkey-server started complaining about not being able to write to /var/run.

Starting MLDonkey: mlnet file[s] not owned by user 113 or group 1001: /var/run -- reown it first

Checking out the files that starts the server, I found out that mldonkey-server was trying to write directly into /var/run. As /var/run is owned by root and MUST BE WRITABLE BY ROOT ONLY for security reason, it is not a wise choose to chmod 777 /var/run.
Instead, you should create a directory owned by mldonkey, namely /var/run/mldonkey and give write access to mldonkey user only in that repertory. Here are the few command lines you need to type:

tester@laptop:~$sudo mkdir /var/run/mldonkey

to create the directory, and

tester@laptop:~$sudo chown mldonkey:mldonkey /var/run/mldonkey

to make that directory owned by mldonkey user.
Now, we need to inform the script starting the service that it has to write pid information in /var/run/mldonkey instead of /var/run. Edit /etc/init.d/mldonkey-server

tester@laptop:~$sudo vi /etc/init.d/mldonkey-server

and change the following line:

PIDFILE=/var/run/$NAME.pid

by

PIDFILE=/var/run/mldonkey/$NAME.pid

After taking into account toni's comment, I went investigating further down. What happen on reboot is that /var/run/mldonkey disappears. In order to correct this, we need to create /var/run/mldonkey in the first place. To do so, I took samba as an example. Here are the line you need to copy in /etc/init.d/mldonkey-server. Replace

PIDFILE=/var/run/$NAME.pid

by

PIDDIR=/var/run/mldonkey
PIDFILE=$PIDDIR/$NAME.pid

and add the following line:

install -o mldonkey -g mldonkey -m 755 -d $PIDDIR

before

start-stop-daemon --start --pidfile $PIDFILE
--exec $WRAPPER -- --start --daemon $WRAPPER_OPTIONS

Here you go, you can now restart mldonkey-server:

tester@laptop:~$sudo /etc/init.d/mldonkey-server start

and will only get the following line:

Starting MLDonkey: mlnet.

Which means that everything went sweet :).

You can contribute or read about the bug on launchpad cheerio

Edit (26/04/2006): A patch has been released by JustusWinter. (mldonkey-server patch)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>