MPD Show Stopper: Difference between revisions

Created page with "'''Question:''' Why won't MPD work 'right out of the box'? '''Answer:''' It doesn't have permissions to create its log file;<syntaxhighlight lang="text"> daemon.err mpd[4369]: exception: failed to open log file "/tmp/mpd.log" (config line 2): Permission denied daemon.err mpd[4478]: exception: failed to open log file "/var/log/mpd.log" (config line 7): Permission denied daemon.err mpd[4540]: exception: failed to open log file "/var/log/mpd.log" (config line 7): Permissio..."
 
mNo edit summary
Line 26: Line 26:
USER="mpd"
USER="mpd"
GROUP="mpd"
GROUP="mpd"
OR change the following items from above, to what is below;
USER="root"
GROUP="root"
</syntaxhighlight>'''Why does it have to be this difficult!?:''' Maybe because OpenWRT is oriented around a 'one user' mentality?  /etc/var/log is really /etc/tmp/log which has its owner set to ROOT and other users only have read permissions, so if a service is run under its own user name and / or group (MPD:MPD), then it won't work.  And some nice person at OpenWRT missed this and used generic MPD /etc/init.d/mpd settings in the file without considering the unique nuances of OpenWRT.  Oh, well.
</syntaxhighlight>'''Why does it have to be this difficult!?:''' Maybe because OpenWRT is oriented around a 'one user' mentality?  /etc/var/log is really /etc/tmp/log which has its owner set to ROOT and other users only have read permissions, so if a service is run under its own user name and / or group (MPD:MPD), then it won't work.  And some nice person at OpenWRT missed this and used generic MPD /etc/init.d/mpd settings in the file without considering the unique nuances of OpenWRT.  Oh, well.
'''...but this error will persist in /tmp/log/mpd.log:''' RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
And that's because when running as mpd:mpd, permissions aren't granted for 'realtime scheduling', nor is the ability to use setcap to allow for mpd:mpd (user:group) to have those permissions.  So better off just setting the User and Group to ROOT for what MPD runs as.