You are not logged in.
I have looked on the forum and elsewhere and whilst I've found a few things, found nothing that specifically seems to relate to my problem, so upfront sorry if the solution to this is someplace. At this point having spent about three hours or more trying to fix this, I'm at a loss as what to do.
The one thing that's confusing me is that I changed nothing and after turning on the PC this morning encountered the problem.
The 'config' file @~/.ncmpcpp contains these lines
##### connection settings #####
#
mpd_host = 192.168.0.1
#
mpd_port = 6600
#
#mpd_connection_timeout = 5
#
## Needed for tag editor and file operations to work.
##
mpd_music_dir = ~/Music
#
mpd_crossfade_time = 10
#mpd.conf has this in it
See: /usr/share/doc/mpd/mpdconf.example
pid_file "/run/mpd/mpd.pid"
db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}The hosts file contains this
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
#::1 localhost.localdomain localhost
# End of fileThank you.
i forgot to add this:
● mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-01-29 10:56:13 SAST; 46min ago
Docs: man:mpd(1)
man:mpd.conf(5)
Process: 4506 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
Main PID: 4506 (code=exited, status=1/FAILURE)
Jan 29 10:56:13 z12 systemd[1]: Starting Music Player Daemon...
Jan 29 10:56:13 z12 mpd[4506]: exception: Failed to bind to '[::]:6600'
Jan 29 10:56:13 z12 mpd[4506]: exception: nested: Failed to bind socket: Address already in use
Jan 29 10:56:13 z12 systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Jan 29 10:56:13 z12 systemd[1]: mpd.service: Failed with result 'exit-code'.
Jan 29 10:56:13 z12 systemd[1]: Failed to start Music Player Daemon.Last edited by johnpiers (2018-01-29 09:43:19)
Offline
Jan 29 10:56:13 z12 mpd[4506]: exception: Failed to bind to '[::]:6600' Jan 29 10:56:13 z12 mpd[4506]: exception: nested: Failed to bind socket: Address already in use
Check what process is listening on port 6600:
sudo ss -tlpnOffline
Thanks for the reply, much appreciated.
This is what I see:
LISTEN 0 5 192.168.0.1:6600 0.0.0.0:* users:(("mpd",pid=1144,fd=8)) Offline
OK, there are two things that strike me as odd there.
First, The mpd service has failed and is not running according to systemd, but there is still a process called "mpd" that's running and listening on that port...? What is the output of this?
systemctl status 1144 # i.e. the PID of that mpd processSecond, the running mpd instance appears to be listening on a specific (outwards) IP address, but only accepts connections from 0.0.0.0, i.e. localhost¹. That seems wrong. Are you connecting from the same machine as mpd is running on, or from a different one?
_____
¹ Actually, it's a bit more complicated than that (see this SuperUser discussion).
Last edited by ayekat (2018-01-29 10:17:31)
Offline
Ok, please bear with me. I'm going to attempt to answer your questions correctly, just stop me if I go off-track.
MPD tell me this:
Jan 29 12:16 : exception: Failed to bind to '192.168.0.1:6600'
Jan 29 12:16 : exception: nested: Failed to bind socket: Address already in use mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-01-29 11:55:26 SAST; 22min ago
Docs: man:mpd(1)
man:mpd.conf(5)
Process: 18090 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
Main PID: 18090 (code=exited, status=1/FAILURE)Everything is on the same PC.
Offline
mpd doesn't fail because of the failure to bind the IPv6 address - that's "normal" (it tries to bind IPv6 & IPv4, only one will succeed)
Stop the service, "ps aux | grep mpd", "nmap -p 6600 192.168.0.1" and run "mpd -v" from an interactive shell - watch the output, then "ps aux | grep mpd", "nmap -p 6600 192.168.0.1", "nmap -p 6600 localhost".
Offline
Sorry, have no clue what I'm doing.
systemctl status 1144
● user@1000.service - User Manager for UID 1000
Loaded: loaded (/usr/lib/systemd/system/user@.service; static; vendor preset: disabled)
Active: active (running) since Mon 2018-01-29 10:47:55 SAST; 1h 45min ago
Main PID: 635 (systemd)
Status: "Startup finished in 64ms."
Tasks: 131
CGroup: /user.slice/user-1000.slice/user@1000.service
├─at-spi-dbus-bus.service
│ ├─662 /usr/lib/at-spi-bus-launcher
│ ├─667 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
│ └─669 /usr/lib/at-spi2-registryd --use-gnome-session
├─dbus.service
│ ├─ 658 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
│ ├─ 740 /usr/lib/gnome-shell-calendar-server
│ ├─ 752 /usr/lib/goa-daemon
│ ├─ 762 /usr/lib/goa-identity-service
│ ├─ 773 /usr/lib/telepathy/mission-control-5
│ ├─ 1012 /usr/lib/dconf/dconf-service
│ ├─ 1070 /usr/bin/tilix --gapplication-service
│ ├─ 1074 -/usr/bin/zsh
│ ├─ 1144 mpd
│ ├─ 4318 -/usr/bin/zsh
│ ├─ 9876 -/usr/bin/zsh
│ ├─10161 /usr/lib/GConf/gconfd-2
│ ├─26317 systemctl status 1144
│ └─26318 less
├─evolution-addressbook-factory.service
│ ├─1014 /usr/lib/evolution-data-server/evolution-addressbook-factory
│ └─1026 /usr/lib/evolution-data-server/evolution-addressbook-factory-subprocess --factory local --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.AddressBookx1014x2 --own-path /org/gnome/e
├─evolution-calendar-factory.service
│ ├─ 991 /usr/lib/evolution-data-server/evolution-calendar-factory
│ ├─1001 /usr/lib/evolution-data-server/evolution-calendar-factory-subprocess --factory contacts --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.Calendarx991x2 --own-path /org/gnome/evolu
│ └─1018 /usr/lib/evolution-data-server/evolution-calendar-factory-subprocess --factory local --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.Calendarx991x3 --own-path /org/gnome/evolutio
├─evolution-source-registry.service
│ └─744 /usr/lib/evolution-data-server/evolution-source-registry
├─gvfs-afc-volume-monitor.service
│ └─797 /usr/lib/gvfs/gvfs-afc-volume-monitor
├─gvfs-daemon.service
│ ├─ 712 /usr/lib/gvfs/gvfsd
│ ├─ 717 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
│ ├─ 9988 /usr/lib/gvfs/gvfsd-trash --spawner :1.14 /org/gtk/gvfs/exec_spaw/0
│ └─10039 /usr/lib/gvfs/gvfsd-burn --spawner :1.14 /org/gtk/gvfs/exec_spaw/1
├─gvfs-goa-volume-monitor.service
│ └─802 /usr/lib/gvfs/gvfs-goa-volume-monitor
├─gvfs-gphoto2-volume-monitor.service
│ └─793 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
├─gvfs-mtp-volume-monitor.service
│ └─806 /usr/lib/gvfs/gvfs-mtp-volume-monitor
├─gvfs-udisks2-volume-monitor.service
│ └─778 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
├─init.scope
│ ├─635 /usr/lib/systemd/systemd --user
│ └─636 (sd-pam)
├─pulseaudio.service
│ └─726 /usr/bin/pulseaudio --daemonize=no
├─tracker-store.service
│ └─929 /usr/lib/tracker-store
├─zeitgeist-fts.service
│ └─957 /usr/lib/zeitgeist/zeitgeist-fts
└─zeitgeist.service
└─949 /usr/bin/zeitgeist-daemon
Jan 29 11:56:17 z12 sudo[18224]: pam_unix(sudo:session): session closed for user root
Jan 29 11:56:45 z12 sudo[18445]: johnpiers : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/bin/nano mpd.conf
Jan 29 11:56:45 z12 sudo[18445]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 29 11:57:50 z12 sudo[18445]: pam_unix(sudo:session): session closed for user root
Jan 29 11:57:55 z12 sudo[18726]: johnpiers : TTY=pts/0 ; PWD=/home/johnpiers ; USER=root ; COMMAND=/usr/bin/ss -tlpn
Jan 29 11:57:55 z12 sudo[18726]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 29 11:57:55 z12 sudo[18726]: pam_unix(sudo:session): session closed for user root
Jan 29 12:32:28 z12 sudo[26099]: johnpiers : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/bin/nano hosts
Jan 29 12:32:28 z12 sudo[26099]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 29 12:32:40 z12 sudo[26099]: pam_unix(sudo:session): session closed for user root
lines 19-72/72 (END)Is this what you looking for?
Offline
mpd doesn't fail because of the failure to bind the IPv6 address - that's "normal" (it tries to bind IPv6 & IPv4, only one will succeed)
Stop the service, "ps aux | grep mpd", "nmap -p 6600 192.168.0.1" and run "mpd -v" from an interactive shell - watch the output, then "ps aux | grep mpd", "nmap -p 6600 192.168.0.1", "nmap -p 6600 localhost".
┌─[~] 3m 50s
└─> ps aux | grep mpd
johnpie+ 1144 0.0 0.3 1067144 50776 ? Ssl 10:48 0:04 mpd
johnpie+ 27121 0.0 0.0 10888 2380 pts/0 S+ 12:37 0:00 grep mpd
┌─[~]
└─> nmap -p 6600 192.168.0.1
Starting Nmap 7.60 ( https://nmap.org ) at 2018-01-29 12:37 SAST
Nmap scan report for z12.lan (192.168.0.1)
Host is up (0.000062s latency).
PORT STATE SERVICE
6600/tcp open mshvlm
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds
┌─[~]
└─> mpd -v
config_file: loading file /home/johnpiers/.config/mpd/mpd.conf
Jan 29 12:37 : exception: Failed to bind to '192.168.0.1:6600'
Jan 29 12:37 : exception: nested: Failed to bind socket: Address already in use
┌─[~]
└─> ps aux | grep mpd
johnpie+ 1144 0.0 0.3 1067144 50776 ? Ssl 10:48 0:04 mpd
johnpie+ 27391 0.0 0.0 10888 2432 pts/0 S+ 12:38 0:00 grep mpd
┌─[~]
└─> nmap -p 6600 192.168.0.1
Starting Nmap 7.60 ( https://nmap.org ) at 2018-01-29 12:38 SAST
Nmap scan report for z12.lan (192.168.0.1)
Host is up (0.000063s latency).
PORT STATE SERVICE
6600/tcp open mshvlm
Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
┌─[~]
└─> nmap -p 6600 localhost
Starting Nmap 7.60 ( https://nmap.org ) at 2018-01-29 12:38 SAST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000050s latency).
rDNS record for 127.0.0.1: localhost.localdomain
PORT STATE SERVICE
6600/tcp closed mshvlm
Nmap done: 1 IP address (1 host up) scanned in 0.04 secondsOffline
Well, there *is* an mpd process running (PID 1144) - if this is after you stopped the service (which itself has failed anyway) it ended up there differently.
mpd -k
ps -p 1144
kill 1144 # if the process is still there
ps -p 1144
kill -9 1144 # if the process is still there
ps aux | grep mpd # still an mpd process?Offline
Well, there *is* an mpd process running (PID 1144) - if this is after you stopped the service (which itself has failed anyway) it ended up there differently.
mpd -k ps -p 1144 kill 1144 # if the process is still there ps -p 1144 kill -9 1144 # if the process is still there ps aux | grep mpd # still an mpd process?
johnpie+ 30967 0.0 0.0 10888 2368 pts/0 S+ 12:53 0:00 grep mpd It says no such process
The above is what I get
Sorry, I'm clueless here.
Offline
... ├─dbus.service │ ├─ ... │ ├─ 1144 mpd │ ├─ ... ...
It appears to have been started by dbus for some awkward reason. My bet is that you are running a desktop environment like GNOME, and somewhere there is now a terminal open that has the line
TerminatedAnyway, as you have killed it, you should now be able to start the mpd service.
Last edited by ayekat (2018-01-29 11:07:27)
Offline
It's still doing the same thing. Not working.
┌─[~/.ncmpcpp] 2m 37s
└─> systemctl status mpd
● mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mpd(1)
man:mpd.conf(5)
┌─[~/.ncmpcpp]
└─> mpd
Jan 29 13:20 : exception: Failed to bind to '192.168.0.1:6600'
Jan 29 13:20 : exception: nested: Failed to bind socket: Address already in use
┌─[~/.ncmpcpp]
└─> systemctl status mpd.service
● mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mpd(1)
man:mpd.conf(5)Offline
Well, there is still something listening on that port (on IPv4—I just realised that the first error was actually about IPv6). Anyway, check again which process is listening on that port with `ss`.
Something must be auto-spawning mpd. But it can't be a systemd socket, because that would launch the systemd service, not some random orphan process...
--edit: And then, after determining the PID of the running mpd instance, run `systemctl status {pid}` again to check where it comes from.
--edit2: Maybe also check in your DE settings if you have somehow configured it to auto-spawn mpd. If it does so, it may do it in its own way rather than using systemd services.
Last edited by ayekat (2018-01-29 11:33:52)
Offline
running "mpd" will not start the service, but the daemon is running so you should be able to talk to it (via a client such as ncmpcpp or just mpc)
Offline
dbus.service
│ ├─ 639 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
│ ├─ 721 /usr/lib/gnome-shell-calendar-server
│ ├─ 733 /usr/lib/goa-daemon
│ ├─ 743 /usr/lib/goa-identity-service
│ ├─ 754 /usr/lib/telepathy/mission-control-5
│ ├─ 986 /usr/lib/dconf/dconf-service
│ ├─ 7166 /usr/lib/GConf/gconfd-2
│ ├─10600 /usr/bin/tilix --gapplication-service
│ ├─10605 -/usr/bin/zsh
│ ├─14687 mpdGoing nowhere fast with this, I am sorry if I'm wasting people's time, but at this point, I'm no closer to getting this fixed or that I even remotely understand why it is not working. Thank's all the same to all who have tried to help me. I'm giving up now, been trying for 6 hours to sort this bs out and I just don't get how I can be so bloody stupid that I can't figure out what to do. Anyway, if someone can spoonfeed me further or think of something obvious that missing, that would be great. Thanks again.
Offline
It's hard to help you more with the given information. Something, somewhere is spawning mpd.
Either it is you typing `mpd` in some shell and then letting it fork and run (and thus subsequent attempt to launch mpd obviously fail), or it is some service that spawns mpd behind your back (in which case I would really urge you to inspect what it is—processes shouldn't just be launched without any reason).
If that was my system, I would start monitoring the mpd executable to find out when it is executed, to see if it correlates with one of my user actions:
inotifywait --monitor -e open /usr/bin/mpd | while read -r event; do notify-send "$event"; done(requires libnotify and inotify-tools)
Otherwise, I would simply uninstall mpd and observe the journal whether there are warning or error messages of processes that fail to launch mpd. And as I suggested above, I would also check that there is nothing in the DE autostart settings that might start mpd. Or try with a simple WM instead, that doesn't do any magic tricks. Or check if mpd is auto-launched even if you don't run X or Wayland at all.
Offline
There's an odity in comment #9
6600 is open on the LAN address but closed on localhost. See whether that's a constant pattern (ie. not random crash-restarts of mpd)
Offline