-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Openhab user groups not added anymore #449
Comments
I don't see missing groups? 🤔 4.2.2$ docker run -e USER_ID=110 -e GROUP_ID=115 -it --rm openhab/openhab:4.2.2 bash -c 'id openhab && groups openhab'
....
+ exec bash -c 'id openhab && groups openhab'
uid=110(openhab) gid=115(openhab) groups=115(openhab),10(uucp),20(dialout),29(audio),11(audio2),14(uucp2),16(dialout2),17(audio3),18(dialout3),32(uucp3),63(audio4),490(dialout4),492(audio5),997(gpio)
openhab : openhab uucp dialout audio audio2 uucp2 dialout2 audio3 dialout3 uucp3 audio4 dialout4 audio5 gpio 4.2.3$ docker run -e USER_ID=110 -e GROUP_ID=115 -it --rm openhab/openhab:4.2.3 bash -c 'id openhab && groups openhab'
...
+ exec bash -c 'id openhab && groups openhab'
uid=110(openhab) gid=115(openhab) groups=115(openhab),10(uucp),20(dialout),29(audio),100(users),11(audio2),14(uucp2),16(dialout2),17(audio3),18(dialout3),32(uucp3),63(audio4),490(dialout4),492(audio5),997(gpio)
openhab : openhab uucp dialout audio users audio2 uucp2 dialout2 audio3 dialout3 uucp3 audio4 dialout4 audio5 gpio Only difference in 4.2.3 is the new users group.
It's a warning not an error. |
Sorry I made a mistake testing this. I actually had a problem with a custom image based on the official image. I only briefly tested this on the official image and this when I saw the "outside of range" warning and confused this with the error I had on my custom image. I should have invested some more time analyzing this. I've now found out what is causing the problem on my custom image: I'm installing the openjdk-17-dbg package to get debug capabilities on the docker image. (e.g. to create memory dumps) systemd-journal:x:999: The systemd-timesync service created by the package is using the same group id as the entrypoint script for the gpio group and this creates the following error on startup: groupadd: GID '997' already exists Do you have an idea how such problems could be avoided when installing custom packages on top of the official image? My idea would be to just create the groups in advance in the Dockerfile and only create the openhab user and assign the groups in the entrypoint file. This way when installing additional packages it would automatically use other group id's for additional services. |
If I find some time I'll update the entrypoint script with a function that checks if a group with the ID already exists and if so add the openhab user to it. |
The problem with that is that the entrypoint is called after additional packages have already created groups. This would still result in the problem that group id 997 will already be taken by the systemd-timesync service. I solved this problem for now by adding the groups directly in my Dockerfile like this:
At the end a custom entrypoint file is copied to the container image where I just removed those lines:
This way the openjdk-17-dbg automatically takes a non used group id. Is there any reason not to do it that way? I could also create a pull request for this if you like. |
Summary
In the latest image (4.2.3) the openhab user is not added to the additional groups anymore. This prevents the process from accessing the Zwave serial port.
Expected Behavior
Openhab user should receive additional groups again. (e.g. dialout group)
Current Behavior
I found the following error in the docker log:
I guess that the newer debian version wants higher user id's.
Possible Solution
Assign higher user and group id's in the entrypoint script.
Steps to Reproduce
openhab : openhab uucp dialout audio audio2 uucp2 dialout2 audio3 dialout3 uucp3 audio4 dialout4 audio5 gpio
Context
ZWave not working anymore. I had to revert to version 4.2.2.
Your Environment
OpenHab running on an Rasperry Pi 5 using Docker.
Image
Docker Host
Configuration
The text was updated successfully, but these errors were encountered: