Default Install of mpd not able to open /var/log/mpd/mpd.log on Disco Dingo so mpd.service fails.

Bug #1842683 reported by ALU
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mpd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Brand new installation of Ubuntu 19.04 (Disco Dingo) on laptop.
Reviewing syslog messages returned the following

Sep 4 09:36:31 REDACTED mpd[1606]: exception: failed to open log file "/var/log/mpd/mpd.log" (config line 39): Permission denied
Sep 4 09:36:31 REDACTED systemd[1590]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Sep 4 09:36:31 REDACTED systemd[1590]: mpd.service: Failed with result 'exit-code'.
Sep 4 09:36:31 REDACTED systemd[1590]: Failed to start Music Player Daemon.

I can easily fix by modifying permissions or modifying the config file, but reporting as this probably impacts others.

Revision history for this message
ALU (c-launchpadmail) wrote :

More information:

$ls -ld /var/log/mpd
drwxr-xr-x 2 mpd audio 4096 Sep 1 00:00 /var/log/mpd/

$ ls -l /var/log/mpd/
total 8
-rw-r--r-- 1 root root 600 Sep 4 09:36 mpd.log
-rw-r--r-- 1 root root 164 Aug 31 21:58 mpd.log.1.gz

$cat /etc/logrotate.d/mpd
/var/log/mpd/*.log {
        weekly
        missingok
        rotate 7
        compress
        notifempty
        copytruncate
        create 600
}

So I'd guess that the create statement in /etc/logrotate.d/mpd should read

   "create 600 mpd audio"

and not just "create 600"

Revision history for this message
Florian Schlichting (fschlich) wrote :

The logrotate.conf(5) manpage explains for "create":
    "Any of the log file attributes may be omitted, in which case those at‐
    tributes for the new file will use the same values as the original log file for the omitted attributes."

So this works, unless you have been running mpd as root. In which case youll have to clean up the mess that this may have left in your filesystem.

Traditionally, mpd tried to be very flexible how it wanted to be run, and provided various knobs and workarounds in the initscript and elsewhere to accommodate different setups. You can use dpkg-statoverride (see mpd.postinst) to set a different owner for /var/log/mpd, like your own user. So defining a fixed user/group like you suggest is not sufficiently backwards-compatible.

On modern setups, logging uses the systemd journal, where this is no longer a concern.

So, I think things are as "perfect" as they can be...

Changed in mpd (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.