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

Broker error on include_dir permissions on HUP #857

Closed
chelliwell opened this issue Jun 13, 2018 · 5 comments
Closed

Broker error on include_dir permissions on HUP #857

chelliwell opened this issue Jun 13, 2018 · 5 comments

Comments

@chelliwell
Copy link

If the configured include_dir has incorrect permissions (e.g. drwx------, and owned by root; with mosquitto running under non-root user), then the broker starts up ok and uses the included conf(s), but if then sent a SIGHUP:

Jun 13 07:49:43 wgs daemon.info mosquitto[908]: Reloading config.
Jun 13 07:49:43 wgs daemon.err mosquitto[908]: Error: Unable to open include_dir '/etc/mosquitto/include.d'.

I guess this is because, at start up, the config is read before the dropping of user privileges, and permissions are not re-checked afterwards.

@toast-uz
Copy link
Contributor

toast-uz commented Jul 29, 2018

I'd like to reconfirm your situation.

  • Run mosquitto by root user.
  • Successfully read mosquitto.conf under the permission root user can only read.
  • Mosquitto.conf describes mosquitto's non-root user.
  • Mosquitto broker daemon run as the non-root user.
  • Sent a SIGHUP
  • Fail to read mosquitto.conf due to incorrect permission.

Right?
So what is the problem?

@toast-uz toast-uz added the Status: Blocked Another issue needs to be resolved first label Jul 29, 2018
@ralight
Copy link
Contributor

ralight commented Aug 1, 2018

The point is that the config is read originally as the root user, so it succeeds. Sending the HUP and it failing is then unexpected.

@ralight ralight added Component: mosquitto-broker Type: Bug and removed Status: Blocked Another issue needs to be resolved first labels Aug 1, 2018
@toast-uz
Copy link
Contributor

toast-uz commented Aug 1, 2018

@ralight if mosquitto daemon run as the root, the config should be reloaded. But, if mosquitto daemon run as the non-root user, I guess the config should not be reloaded. This issue's situation is the latter. So I guess it's normal to fail to reload. I've misunderstood?

@momoskitto
Copy link

This issue looks like a duplicate of
#588

@ralight
Copy link
Contributor

ralight commented Feb 3, 2021

It shouldn't be possible this occurs as of 2.0.

@ralight ralight closed this as completed Feb 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants