1

Running

$ mpd

I am prompted with

socket: Failed to bind to '127.0.0.1:6600': Address already in use

But if I run:

 $ sudo service mpd start

and check its status, I get

systemd[1]: Started Music Player Daemon.

Note that in what is to come, assume that:

 $ sudo service mpd stop

has been run.

Questions

  • What is the difference between the two, why does one give an error, and the other not?
  • How can I track/find how the socket is being used? As mentioned, first we stop the service, if it is running?

    $ sudo service mpd stop
    

I search over stackexchange, and the solutions mentioned don't find anything.

$ sudo lsof -i -n -P|grep 6600 

returns nothing

$ sudo netstat -tulpn |grep 6600 

return nothing

$ sudo ss -npt|grep 6600

return nothing. But, again,

$ mpd

returns

socket: Failed to bind to '127.0.0.1:6600': Address already in use

What do I not understand?

  • 1
    Are you inside a vm à container or something like that ? Lsof is nicer When written : lsof -n -i TCP:6600 ;-) – Kiwy Jul 18 '18 at 10:02
  • If using systemd you should probably also try sudo systemctl stop mpd.socket if it is using a socket to start the service. – meuh Jul 18 '18 at 15:31
1

It looks like you are using Systemd

As mentioned in the comments you also need to stop the socket

sudo systemctl stop mpd.socket
| improve this answer | |
0

It might be a bit late but I had the same problem and setting bind_to_address in mpd.conf file to "0.0.0.0" seemed to fix it.

Also there is a good explanation of why that might be happening here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.