Skip to content
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

Alleged permission issue regarding logfile (readonly) #283

Open
passibe15 opened this issue Dec 9, 2024 · 3 comments
Open

Alleged permission issue regarding logfile (readonly) #283

passibe15 opened this issue Dec 9, 2024 · 3 comments

Comments

@passibe15
Copy link
Contributor

passibe15 commented Dec 9, 2024

Describe the bug
Starting a container with image tag 4-bullseye and env variables FHEM_UID and FHEM_GID set to a non-default value, FHEM gives the following error message:
Messages collected while initializing FHEM:configfile: logfile is readonly, it is set in the FHEM_GLOBALATTR environment

However, the logfile is writeable without any problems. Also, all permissions get set correctly (i.e. entry.sh is doing its job correctly).

To Reproduce
Steps to reproduce the behavior:

  1. Set FHEM_UID and FHEM_GID to some non-default value
  2. Start container
  3. Observe reading init_errors in device global
  4. Observe logfile and notice it is being written to despite the error message
  5. Change to 3-bullseye and observe that error message vanishes

Expected behavior
No error message

Additional context
Another user reported that they also get an error message for the PID file. This first occurred after switching from 3-bullseye to 4-bullseye.
See here (also see following forum posts for additional context).

Also, I am not sure if this is an issue within fhem.pl or with the container environment, however, given that the issue was not present in 3-bullseye I am assuming it is an issue with the code in this repo, rather than FHEM itself.

For the sake of completeness, here is the content of /proc/$PID/environ:
SHELL=/bin/bashFHEM_GLOBALATTR=nofork=0 updateInBackground=1 logfile=log/fhem-%Y-%m-%d.log pidfilename=log/fhem.pidHOSTNAME=ha_fhemtestLANGUAGE=en_US:enPERL_JSON_BACKEND=Cpanel::JSON::XS,JSON::XS,JSON::PP,JSON::backportPPLC_ADDRESS=de_DE.UTF-8LC_NAME=de_DE.UTF-8LC_MONETARY=de_DE.UTF-8UMASK=0037PWD=/opt/fhemLOGNAME=fhemTZ=Europe/BerlinLOGFILE=/opt/fhem/log/fhem-%Y-%m-%d.logHOME=/opt/fhemFHEM_UID=7073LANG=en_US.UTF-8LC_PAPER=de_DE.UTF-8PERL5LIB=/usr/src/app/core/lib/perl5:/usr/src/app/3rdparty/lib/perl5GPIO_GID=6002FHEM_GID=7067TERM=xtermUSER=fhemCONFIGTYPE=fhem.cfgDOCKER_GW=172.21.0.1I2C_GID=6003TIMEOUT=10SHLVL=1LC_TELEPHONE=de_DE.UTF-8LC_MESSAGES=en_DK.UTF-8LC_MEASUREMENT=de_DE.UTF-8FHEM_PERM_FILE=0640LC_TIME=de_DE.UTF-8DOCKER_HOST=172.21.0.1PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binTELNETPORT=7072DOCKER_HOSTNETWORK=0MAIL=/var/mail/fhemFHEM_PERM_DIR=0750BLUETOOTH_GID=6001LC_NUMERIC=de_DE.UTF-8DOCKER_PRIVILEGED=1OLDPWD=/opt/fhem_=/usr/local/bin/perlroot

@no-Legend
Copy link

no-Legend commented Dec 9, 2024

Same Problem with my Installation.
Changed the Version from 3 to 4 bullseye yesterday evening.
Reported the error also at the FHEM forum

also get an error. Essbare for the pidfile

@sidey79
Copy link
Contributor

sidey79 commented Dec 9, 2024

I don't think that this is an error, its more like some information
https://github.com/fhem/fhem-mirror/blob/cfaeb4e68c0699bbefefffe767b79e4f94c23439/fhem/fhem.pl#L2938

Because if a attribute is defined via an environment variable you can't overwrite it from the fhem itself, it must be changed via the environment variable which is controlled by the container.

@passibe15
Copy link
Contributor Author

Oh. So "readonly" means that the attribute logfile is readonly? Not the logfile itself? Ok. Maybe that message should be clarified then (but not an issue for this repo, of course).

But that still doesn't explain why this only happens when UID/GID is changed to non-default …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants