-
-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DietPi-Software | MPD: Requires root permissions in some cases #2462
Comments
@maartenlangeveld We updated MPD to a new version and it runs as
EDIT: Ah lol just saw your edit that this indeed was the solution. 😄 |
I have rpi zero w with Justboom Digi Zero HAT |
I can second this issue. I'm running v6.21.1 on an Odroid C2 with a HIFI Shield 2 DAC shield. If I run mpd with user "mpd" (with or without group "dietpi" set in mpd.conf) then mpd.log shows:
I see this when trying to play a track or even query the server with mpc. I've checked the groups on the mpd user and it has: mpd audio dietpi. (I may have added one of them in my trying to get stuff working, so not sure if these are all default or not offhand) Does mpd require any additional groups to get things working? Or could it be ACLs? I haven't checked those yet. Let me know if I can provide any further info or do any testing. Sidenote: in regard to #2472 mpd v0.21+ now has the ability to include files. Could that be of assistance with preventing per-instance customization overwrites if we updated the version from 0.20.x to 0.21.x? |
Strange. Only works if we specify Would appear MPD ignores system applied groups, only applies whats set in
Cant see a way of adding multiple groups to |
Ah hmm obviously the given group is not added but overrides the groups the user is inside. Perhaps either giving no group works, if user is already added to both via usermod -a -G dietpi audio Perhaps the same is the case when adding/setting a group via systemd unit, so we need to avoid setting a group there if multiple are required? |
Just tested. In case of systemd units the According to http://www.mpdconf.org/wiki/index.php?title=Mpd.conf setting no group in So another approach would be to not set any user+group in mpd.conf and instead set this inside the systemd unit which does not override the users groups. |
Thanks for looking into this, @Fourdee and @MichaIng! @MichaIng : I applied your idea of using The only possible gotcha may be the Any reason why mpd should use the dietpi group at all and not just use the audio group? Does the dietpi group bring anything special to this service? |
AFAIK there was another setting to allow But indeed it is quite different if the initial mpd binary is executed as non-privileged user or it forks of a sub process as non-privileged user. That it works in your case is already a good test, so generally ownership/permissions of the files/dirs accessed by the binary seem to allow this. But should be tested at best by some more users, e.g. during beta phase for v6.22 😃. |
Will apply the fix and patch for v6.22 |
- DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service, to ensure the MPD user can use both dietpi and audio groups: https://github.com/Fourdee/DietPi/issues/2462
Test with RPi:
Resolved for v6.22. |
Creating a bug report/issue
Required Information
DietPi version |
G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=20
G_DIETPI_VERSION_RC=5
G_GITBRANCH=master
G_GITOWNER=Fourdee
Distro version | 9.6
Kernel version | Linux DietPi 4.14.79+ Letsencrypt supports Free Noip.com Dynamic DNS #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux
SBC device | RPi Zero W (armv6l)
Power supply used | 5V 2A
SDcard used | SanDisk ultra
Additional Information (if applicable)
--> updated/migrated by DietPi update to v6.20.5
dietpi-bugreport
ID |sed -n 5p /DietPi/dietpi/.hw_model
Steps to reproduce
Expected behaviour
Actual behaviour
Extra details
cat /var/log/mpd/mpd.log :
Jan 29 02:45 : avahi: Service 'JustBoom DietPi' successfully established.
Jan 29 02:45 : player: played "http://icecast.omroep.nl/radio1-bb-mp3"
Jan 29 02:45 : exception: Failed to open "JustBoom DietPi" [alsa]
Jan 29 02:45 : exception: nested: Failed to open ALSA device "default": Permission denied
!! When changing user from "mpd" back to "root" (as in v6.19.7) in /etc/mpd.conf problem is solved.
The text was updated successfully, but these errors were encountered: