# MLDonkey startup problems

## _easyrider_

Im having some big problem starting MLDonkey after a reboot. It tell's me that an mlnet.pid is allready running. When i the delete the file /home/p2p/.mldonkey/mlnet.pid mldonkey starts without problems. But why is that file then not deleted when i reboot or restart MLDonkey??..

Some help please?  :Smile: 

----------

## metalhedd

Check to make sure MLDonkey is running as the p2p user and that the permissions on the directory are ok? other than that I can't help, i recently installed it without a hitch.

----------

## _easyrider_

Well these two things are correct, so that's not the problem... It just looks like when i reboot my server, it forgets to delete the mlnet.pid file. Strange..

----------

## spiralvoice

it seems mldonkey is not closed properly.

mldonkey 2.6.5 checks this pid file if a process with that number is still working

and deletes stalled pid files, this should help you.

----------

## frozenJim

 *easyrider wrote:*   

> But why is that file then not deleted when i reboot or restart MLDonkey??.. 

 

The answer to your question is: It should delete it upon startup but it does not.  So anytime there is a problem with mldonkey, you will not be able to restart it until ROOT goes in and deletes the mlnet.pid file.  I call it a bug.  

For my users, who may NEVER use root, I am trying to create a little applet to kick the donkey back to life.  Unfortunately I don't understand enough about suid to make the darned thing go.  Have a peek:

```
#!/bin/bash

if [ /home/p2p/mldonkey/mlnet.pid ]; then

  echo 'Kicking the Donkey...'

  rm /home/p2p/mldonkey/mlnet.pid

  /etc/init.d/mldonkey stop

  /etc/init.d/mldonkey start

else

  echo "Donkey needs no kicking."

fi
```

And permissions for this file (called kick_the_donkey) are:

```
linux james # ls -lAh /bin/kick_the_donkey

-rwsrwsrwx 1 root users 225 Aug 12 20:57 /bin/kick_the_donkey
```

Unfortunately, when I run it as a non-root user, it acts like the suid is not even there:

```
james@linux ~ $ kick_the_donkey

Kicking the Donkey...

rm: remove write-protected regular file `/home/p2p/mldonkey/mlnet.pid'? y

rm: cannot remove `/home/p2p/mldonkey/mlnet.pid': Permission denied

 * /sbin/runscript.sh: must be root to run init scripts

 * /sbin/runscript.sh: must be root to run init scripts

```

Can anyone tell me what I'm missing?  I want my users to simply push the "Kick The Donkey" button to get this MULISH and STUBBORN application running when I am not around.

----------

## spiralvoice

 *frozenJim wrote:*   

>  *easyrider wrote:*   But why is that file then not deleted when i reboot or restart MLDonkey??..  
> 
> The answer to your question is: It should delete it upon startup but it does not.  So anytime there is a problem with mldonkey, you will not be able to restart it until ROOT goes in and deletes the mlnet.pid file.  I call it a bug.

 

Gentoo stable has still 2.6.4, which is nearly one (!) year old.

From Changelog:

 *Quote:*   

> 2005/10/11: version 2.6.5 = tag release-2-6-5
> 
> 4499: Check for stalled pid file and remove it if MLDonkey is not running

 

MLDonkey itself takes care of leftover mlnet.pid for ages now.

So update to unstable 2.7.7 which is in fact by far more stable than 2.6.4 especially

when it comes up to this bug: https://bugs.gentoo.org/show_bug.cgi?id=138373#c3

Current CVS also takes care of config_files_space.tmp

 *Quote:*   

> 2006/07/14
> 
> 5235: Lock config_files_space.tmp and delete unused file on startup

 

----------

## frozenJim

Aha.

I see that now and will unmask mldonkey.

Do you know why it is still masked after all this time?  Are there serious problems, or just a lack of testing?

----------

## spiralvoice

 *frozenJim wrote:*   

> Do you know why it is still masked after all this time?

 

I do not know why it takes so long to make MLDonkey stable:

https://bugs.gentoo.org/show_bug.cgi?id=138373

----------

