You are not logged in.
I setup mpd to run launched by systemd. What I'm finding is that systemd cannot properly load mpd on boot.
% status mpd
mpd.service - Music Player Daemon
Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
Active: failed (Result: exit-code) since Sun, 21 Oct 2012 08:02:17 -0400; 3min 55s ago
Process: 307 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/mpd.service
Oct 21 08:02:17 mars systemd[1]: Started Music Player Daemon.
Oct 21 08:02:17 mars mpd[307]: Failed to bind to '192.168.1.2:6600': Cannot assign requested addressI looked at /usr/lib/systemd/system/mpd.service and found that it only loads "After=sound.target" so I modified this service file to include "After=sound.target network.target" thinking that would solve the problem. It did not. After a reboot again, no mpd and the same error.
Now I'm wondering if netcfg or if net-auto-wired is to blame. I am using /usr/lib/systemd/system/net-auto-wired.service to start my network and am wondering if it isn't reporting to systemd that it is providing "network.target" which is a requirement to launch mpd.service.
For reference:
% cat /etc/network.d/ethernet-static
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR='192.168.1.2'
GATEWAY='192.168.1.1'
DNS=('192.168.1.1')
PRE_DOWN='/bin/ps aux | /usr/bin/grep ssh | /usr/bin/grep -v grep | /usr/bin/awk {"print $2"} | /usr/bin/xargs -r kill'
POST_UP='/usr/sbin/ip link set eth0 mtu 4000'Journalctl shows that both mpd and net-auto-wired are starting at the same time (Oct 21 08:15:34) even though I have that "After=network.target" in the mpd.service
% sudo journalctl _SYSTEMD_UNIT=net-auto-wired.service
----- Reboot -----
Oct 21 08:15:34 mars ifplugd[291]: ifplugd 0.28 initializing.
Oct 21 08:15:34 mars ifplugd[291]: Using interface eth0/68:02:CA:09:0E:3A with driver <e1000e> (version: 2.0.0-k)
Oct 21 08:15:34 mars ifplugd[291]: Using detection mode: SIOCETHTOOL
Oct 21 08:15:34 mars ifplugd[291]: Initialization complete, link beat not detected.
Oct 21 08:15:37 mars ifplugd[291]: Link beat detected.
Oct 21 08:15:38 mars ifplugd[291]: Executing '/etc/ifplugd/netcfg.action eth0 up'.
Oct 21 08:15:38 mars ifplugd[291]: client: up
Oct 21 08:15:38 mars ifplugd[291]: client: loading ethernet-static
Oct 21 08:15:38 mars ifplugd[291]: client: :: ethernet-static up [done]
Oct 21 08:15:38 mars ifplugd[291]: Program executed successfully.
Oct 21 08:15:38 mars ifplugd[291]: Link beat lost.
Oct 21 08:15:42 mars ifplugd[291]: Link beat detected.% sudo journalctl _SYSTEMD_UNIT=mpd.service
----- Reboot -----
Oct 21 08:15:34 mars mpd[311]: Failed to bind to '192.168.1.2:6600': Cannot assign requested addressLast edited by graysky (2012-10-22 19:59:01)
Offline
No love from my Arch homies? Falconindy?
Offline
What you did with the service file seems right except you shouldn't modify units in /usr/lib, but copy them to /etc/systemd. But I didn't understand 2 things:
1. Why do you use net-auto-wired with a static IP? You see, ifplugd will take arbitrary amount of time to start, might even after the rest of the system has booted. I'd suggest disabling net-auto-wired.service and use netfcg.service. Also, I'd incl;ude After=netcfg.service in mpd.service to be very explicit...
2. Why can't mpd keep trying to bind like ntpd does? There is got to be a config option for that.
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
These are excellent suggestions, Leonid. Thank you.
1) Switched to plain netcfg.service and removed ifplugd.
2) Added a single line to my mpd.service in the [Unit] section that reads, "After=netcfg.service" which solved the problem.
So I think I should open a bug against netcfg assuming it is somehow not providing systemd with the 'network.target' it needs to wait to startup mpd.
EDIT: https://bugs.archlinux.org/task/32161
Last edited by graysky (2012-10-22 19:58:36)
Offline
Maybe I'm misunderstanding, but if netcfg is not providing network.target I'd expect to see a lot more users having issues.
Myself for example. But systemd has never tried to start dhcpd before netcfg brings my NICs up.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
@alphaniner - I can't explain it. It's in the dev's hands now ![]()
Offline