MPD on localhost won't work if there's no Wifi!?
Hello to all!
I've had this problem with previous versions of MPD, and now I'm using
0.18.7, but the problem persists. This is an odd situation: MPD is
configured to run on 127.0.0.1, but if the Wifi is disconnected in
NetworkManager, it starts spitting error messages and refuses to play:
$ mpc
error: Failed to resolve host name
$ ncmpcpp
error: Failed to resolve host name
$ MPD_HOST=127.0.0.1 mpc
error: Failed to resolve host name
$ cat /etc/hostname
localhost
$ cat /etc/hosts
127.0.0.1 localhost
$ egrep -v '^#|^$' .mpd/mpd.conf
music_directory "~/.mpd/database"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/tag_cache"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
bind_to_address "127.0.0.1"
audio_output {
type "pulse"
name "My Pulse Output"
}
mixer_type "software"
max_playlist_length "32768"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
The only thing I noticed is that NetworkManager erases /etc/resolv.conf
when disconnected, but I tried writing to resolv.conf myself, and it
didn't help. But If I reconnect the Wifi, I can play music again. The
network is very unstable where I am today, so I can't play music often.
I have also tried this, but it doesn't make any difference:
bind_to_address "localhost"
I have asked for help at http://forum.musicpd.org/, but they said
something is not right in my network, and I believe that could be
actually the case.
Thank you for your attention!
Teresa and Junior
Reply to: