Could not stop mpd service (No /usr/bin/mpd found running; none killed)

6.9k views Asked by At

Whenever I want to stop my mpd server running in my RaspBMC by typing:

service mpd stop

The console shows the typical [ ok ] message:

[ ok ] Stopping Music Player Daemon: mpd.

But the service doesn't really stops at all (the process keeps running). I've made a deep search in the service script and found the call to start-stop-daemon:

start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile ~/.mpd/pid --exec /usr/bin/mpd

If I execute this command in a console (without the --quiet option) I get the following message:

No /usr/bin/mpd found running; none killed.

But the process is really running. I've checked both the pid file and exec file (/usr/bin/mpd) and they are correct. I noticed this error disappears when running the command as superuser (with sudo), so it seems to be a permissions issue, but I don't really understand why the /etc/init.d/mpd script is not capable of detecting the process being run... it's always called with sudo, so it should not have permission issues, shouldn't?

What's wrong with this configuration? What should I change to make the service stop correctly using the service command?

2

There are 2 answers

0
Lluís Suñol On BEST ANSWER

I finally found it! The problem is the path specified for the pid file in the mpd.conf is

pid_file "~/.mpd/pid"

This seems not to work properly when stopping it from service command. For the moment I changed it for

pid_file "/home/MyUserName/.mpd/pid"

and works fine, but as soon as possible, I'll move it to /var/run/mpd/ as it seems to be the right place to be in.

2
Nachiket Kate On

yes it could be a permission issue.

  1. if you just want to kill the service then please try,

    "pidof mpd" or "ps aux | grep mpd"

    "sudo kill -SIGTERM $pid"

    or more stronger signal , "sudo kill - SIGKILL $pid"

generally these signals are used when trying to kill the process. SIGTERM will send terminate signal to process which is near to kill the process safely but SIGKILL is more powerful signal

But in your case, you can try this if permissions is not the issue.