Logitech / slimserver-platforms

Platform-specific build tools for slimserver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

squeezeboxserver user in docker image is not added to group $PGID

doctorjames opened this issue · comments

The squeezeboxserver user is set up as part of the Dockerfile build process.

The line usermod -g $PGID squeezeboxserver has therefore already been executed when building the image, not with the user specified PGID at runtime.

If the user overrides the group using the PGID environment variable, this is used to chown various files in start-container.sh but the squeezeboxserver user is not added to this group. This prevents using the PGID to allow access to music files mounted from the host.

I would expect changing:

usermod -o -u "$PUID" squeezeboxserver
groupmod -o -g "$PGID" nogroup

to:

groupmod -o -g "$PGID" nogroup
usermod -o -u "$PUID" -g nogroup squeezeboxserver

in start-container.sh would make it work, however using a differently named group to "nogroup" would be semantically better since it is a group, and in my use case, one that serves an access role.

It might be cleanest to specify an (optional) group for the read/write files (i.e. what is affected at present) and a separate group that the squeezeboxserver user is put in by start-container.sh intended for access to the read only music.

I am sorry to bump this, but could anyone implement the fixes that @doctorjames suggests? They seem to be insightful.

I wish I read this bugreport prior to wasting 90 minutes on debugging the FS access denial. %)

Yes, would be great if somebody could come up with a pull request. Thanks!