[Pkg-mpd-maintainers] Bug#887834: Bug#887834: Bug#887834: mpd installation fails, cannot open /var/lib/mpd/tag_cache, /run/mpd/pid
Florian Schlichting
fsfs at debian.org
Fri Nov 5 04:55:52 GMT 2021
Hi Ryan (and Max please see below):
> and have the following minimal mpd.conf:
>
> --------------------------------------------------
> music_directory "/var/lib/mpd/music"
> db_file "/var/lib/mpd/tag_cache"
> pid_file "/run/mpd/pid"
> state_file "/var/lib/mpd/state"
> log_level "verbose"
>
> user "mpd"
> bind_to_address "127.0.0.1"
>
> audio_output {
> type "null"
> name "null"
> }
> --------------------------------------------------
please, for now, delete or comment out the pid_file line
> Attempting to start mpd results in:
>
> --------------------------------------------------
> rak at zeta:~$ sudo service mpd start
> Job for mpd.service failed because a fatal signal was delivered to the control process.
> See "systemctl status mpd.service" and "journalctl -xeu mpd.service" for details.
> rak at zeta:~$ sudo systemctl status mpd.service
> × mpd.service - Music Player Daemon
> Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
> Active: failed (Result: signal) since Thu 2021-11-04 13:49:36 EDT; 2s ago
> TriggeredBy: × mpd.socket
> Docs: man:mpd(1)
> man:mpd.conf(5)
> file:///usr/share/doc/mpd/html/user.html
> Process: 474546 ExecStart=/usr/bin/mpd --no-daemon $MPDCONF (code=killed, signal=ABRT)
> Main PID: 474546 (code=killed, signal=ABRT)
> CPU: 175ms
>
> Nov 04 13:49:36 zeta mpd[474546]: sndfile: libsndfile-1.0.31
> Nov 04 13:49:36 zeta mpd[474546]: hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
> Nov 04 13:49:36 zeta mpd[474546]: adplug: adplug 2.3.3
> Nov 04 13:49:36 zeta mpd[474546]: exception: Failed to open '/var/lib/mpd/tag_cache': No such file or directory
> Nov 04 13:49:36 zeta mpd[474546]: curl: version 7.74.0
> Nov 04 13:49:36 zeta mpd[474546]: curl: with GnuTLS/3.7.2
> Nov 04 13:49:36 zeta mpd[474546]: mpd: ../src/event/Loop.cxx:60: EventLoop::~EventLoop(): Assertion `sockets.empty()' failed.
> Nov 04 13:49:36 zeta systemd[1]: mpd.service: Main process exited, code=killed, status=6/ABRT
> Nov 04 13:49:36 zeta systemd[1]: mpd.service: Failed with result 'signal'.
> Nov 04 13:49:36 zeta systemd[1]: Failed to start Music Player Daemon.
The tag_cache exception is non-fatal. The problem here is the Assertion
failure, which is #998310 and fixed in mpd 0.23.3-2
However, Max: behind this hides another problem, which is why I asked
Ryan to delete the pid_file configuration: as part of 0.23.3 you added
the "RuntimeDirectory=mpd" directive to both mpd.service units. In the
absence of User and Group directives, this causes /run/mpd to change
ownership from mpd:audio (as created by our
/usr/lib/tmpfiles.d/mpd.conf) to root:root, which means that mpd would
have to be run as root in order to be able to create a socket or a
pidfile (yes, legacy) there. I think that's broken from an upstream
perspective as well, and only works when running mpd as user.
I suppose the best way forward is to specify User=mpd and Group=audio
in the system unit, however this immediately hits a snag when mpd tries
to open its log file /var/log/mpd/mpd.log, which up to now is created as
root. This we could probably work around in Debian, and defaulting to
log to syslog/journal also feels sensible, but I'm not sure if there may
be other things that mpd might want to be root for when starting up as a
system service?
Florian
More information about the Pkg-mpd-maintainers
mailing list