Bug#913328: closed by Florian Schlichting (Re: [Pkg-mpd-maintainers] Bug#913328: both system and user service?)
> > and tracked it down to mpd is installed as both a system service (which > > I've configured, and been using for a while) and a systemd user service, > > are you sure this is the systemd user service, rather than > /etc/xdg/autostart/mpd.desktop? Yes. Here is a fuller excerpt from the journal: Nov 09 04:12:06 Watt systemd[1]: Starting User Manager for UID 1000... Nov 09 04:12:06 Watt systemd-logind[952]: New session 2 of user anthony. Nov 09 04:12:06 Watt systemd[1]: Started Session 2 of user anthony. Nov 09 04:12:06 Watt systemd[3999]: pam_unix(systemd-user:session): session opened for user anthony by (uid=0) Nov 09 04:12:07 Watt systemd[3999]: Listening on GnuPG cryptographic agent and passphrase cache (restricted). Nov 09 04:12:07 Watt systemd[3999]: Listening on GnuPG cryptographic agent and passphrase cache. Nov 09 04:12:07 Watt systemd[3999]: Starting D-Bus User Message Bus Socket. Nov 09 04:12:07 Watt systemd[3999]: Reached target Timers. Nov 09 04:12:07 Watt mpd[4010]: exception: failed to open log file "/var/log/mpd/mpd.log" (config line 38): Permission denied Nov 09 04:12:07 Watt systemd[3999]: Reached target Paths. Nov 09 04:12:07 Watt systemd[3999]: Listening on GnuPG network certificate management daemon. Nov 09 04:12:07 Watt systemd[3999]: Listening on Sound System. Nov 09 04:12:07 Watt systemd[3999]: Listening on GnuPG cryptographic agent (ssh-agent emulation). Nov 09 04:12:07 Watt systemd[3999]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers). Nov 09 04:12:07 Watt systemd[3999]: Listening on D-Bus User Message Bus Socket. Nov 09 04:12:07 Watt systemd[3999]: Reached target Sockets. Nov 09 04:12:07 Watt systemd[3999]: Reached target Basic System. Nov 09 04:12:07 Watt systemd[1]: Started User Manager for UID 1000. Nov 09 04:12:07 Watt systemd[3999]: Starting Music Player Daemon... Nov 09 04:12:07 Watt systemd[3999]: mpd.service: Main process exited, code=exited, status=1/FAILURE Nov 09 04:12:07 Watt systemd[3999]: mpd.service: Failed with result 'exit-code'. Nov 09 04:12:07 Watt systemd[3999]: Failed to start Music Player Daemon. Nov 09 04:12:07 Watt systemd[3999]: Reached target Default. Nov 09 04:12:07 Watt systemd[3999]: Startup finished in 743ms. Nov 09 04:12:07 Watt systemd[3999]: Started D-Bus User Message Bus. So that's clearly the systemd user service. (I'm not sure the weird setup I have on that machine even pays attention to /etc/xdg/autostart) > > > which I'm not sure what it's for, but it (obviously) fails to write to > > system-wide logs. > > > > Seems like only one of the two ways should run on a given machine. Or at > > least the user service ought to use a different config file. > > There are many ways MPD can be started. The default nowadays is when a > user is logging into a desktop environment, as most users have their own > music collection and their desktop session starts a pulseaudio instance > that needs to be used as output. This works best with a personal > ~/.mpdconf containing adjusted paths etc. I wonder if it wouldn't make sense to add a ConditionPathExists=%h/.mpdconf (or even Assert…) to the user unit. I'm not sure it makes sense to try to start from both XDG autostart and systemd... one of those is going to fail, and probably in an unpredictable race — but I'm not sure what the best way to fix that is (since of course systemd and the systemd user session are optional). (I'm running mpd for yet another purpose — its handling the library management for a remote mpd running on a Raspberry Pi, which is what does all the actual music playing.)
Bug#913328: both system and user service?
Package: mpd Version: 0.20.23-1+b1 Severity: minor -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I got a log message this morning: Nov 09 04:12:07 Watt mpd[4010]: exception: failed to open log file "/var/log/mpd/mpd.log" (config line 38): Permission denied and tracked it down to mpd is installed as both a system service (which I've configured, and been using for a while) and a systemd user service, which I'm not sure what it's for, but it (obviously) fails to write to system-wide logs. Seems like only one of the two ways should run on a given machine. Or at least the user service ought to use a different config file. - -- System Information: Debian Release: buster/sid APT prefers testing-debug APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (130, 'unstable-debug'), (130, 'unstable'), (120, 'experimental-debug'), (120, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.18.0-2-amd64 (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages mpd depends on: ii adduser 3.118 ii init-system-helpers 1.55 ii libadplug-2.2.1-0v5 2.2.1+dfsg3-0.4 ii libao41.2.2+20180113-1 ii libasound21.1.7-1 ii libaudiofile1 0.3.6-4 ii libavahi-client3 0.7-4+b1 ii libavahi-common3 0.7-4+b1 ii libavcodec58 10:4.0.2-dmo4 ii libavformat58 10:4.0.2-dmo4 ii libavutil56 10:4.0.2-dmo4 ii libbz2-1.01.0.6-9 ii libc6 2.27-8 ii libcdio-cdda2 10.2+0.94+2-dmo4 ii libcdio-paranoia2 10.2+0.94+2-dmo4 ii libcdio18 1:2.0.0-dmo2 ii libcurl3-gnutls 7.61.0-1 ii libdbus-1-3 1.12.10-1 ii libexpat1 2.2.6-1 ii libfaad2 2.8.8-1 ii libflac8 1.3.2-3 ii libfluidsynth11.1.11-1 ii libgcc1 1:8.2.0-9 ii libgme0 0.6.2-1 ii libicu60 60.2-6 ii libid3tag00.15.1b-13 ii libiso9660-11 1:2.0.0-dmo2 ii libixml10 1:1.8.4-2 ii libjack0 [libjack-0.125] 1:0.125.0-3 ii libmad0 0.15.1b-9 ii libmikmod33.3.11.1-4 ii libmms0 0.6.4-3 ii libmodplug1 1:0.8.9.0-2 ii libmp3lame0 1:3.100-dmo1 ii libmpcdec62:0.1~r495-1+b2 ii libmpdclient2 2.11-1 ii libmpg123-0 1.25.10-2 ii libnfs11 1:2.0.0-dmo1 ii libogg0 1.3.2-1+b1 ii libopenal11:1.19.1-1 ii libopus0 1.3~beta+20180518-1 ii libpulse0 12.2-2 ii libroar2 1.0~beta11-11 ii libsamplerate00.1.9-2 ii libshout3 2.4.1-2 ii libsidplayfp4 1.8.8-1 ii libsmbclient 2:4.9.1+dfsg-2 ii libsndfile1 1.0.28-4 ii libsoxr0 0.1.2-3 ii libsqlite3-0 3.25.2-1 ii libstdc++68.2.0-9 ii libsystemd0 239-11 ii libupnp13 1:1.8.4-2 ii libvorbis0a 1.3.6-1 ii libvorbisenc2 1.3.6-1 ii libwavpack1 5.1.0-4 ii libwildmidi2 0.4.2-1 ii libwrap0 7.6.q-27 ii libyajl2 2.1.0-3 ii libzzip-0-13 0.13.62-3.1 ii lsb-base 9.20170808 ii zlib1g1:1.2.11.dfsg-1 mpd recommends no packages. Versions of packages mpd suggests: ii avahi-daemon 0.7-4+b1 pn icecast2 ii mpc [mpd-client] 1:0.31-dmo1 ii pulseaudio12.2-2 -BEGIN PGP SIGNATURE- iHMEARECADMWIQTlAc7j4DAtSNRJJ0z7P4jCVepZ/gUCW+WuvRUcYW50aG9ueUBk ZXJvYmVydC5uZXQACgkQ+z+IwlXqWf7eUwCfRL7HOM5AN70Cj/j9qLrbbzxC1vYA n02pEOY4fT2vKlQ2iehDTWNr76FD =WNLX -END PGP SIGNATURE-