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

1 minute read

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 directory. 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)