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

Dynamic security changes not persisted to disk across restarts #2938

Closed
yobyot opened this issue Oct 28, 2023 · 2 comments
Closed

Dynamic security changes not persisted to disk across restarts #2938

yobyot opened this issue Oct 28, 2023 · 2 comments

Comments

@yobyot
Copy link

yobyot commented Oct 28, 2023

No matter where I place the Dynamic Security JSON file nor how I change its ownership and permissions, Mosquitto 2.0.18 will not persist any settings across restarts. IOW, it simply does not write the changes to the JSON file.

Please see the annotated screenshots below which document this sequence:

  1. Issue mosquitto_ctrl dynsec listClients (I'm using an options file for authentication). Confirm admin client exists.
  2. Issue ...createClient... to create client "iotClient"
  3. Confirm new client exists via mosquitto_ctrl.
  4. Restart Mosquitto.
  5. Issue ...listClients`. Client added above is not listed.

You can see in the VS code terminal that the user specified in mosquitto.conf owns the JSON file. I've also included a screenshot of the JSON file before step 4 above.

At this point, the client exists but has not been persisted to the JSON file.

I've also included a screenshot of the log file, which appears to show that the $CONTROL/dynamic-security/v1 topic is receving the requests from mostquitto_ctrl.

1

x

3

@mrchipset
Copy link

Hi, @yobyot. I have tried the 2.0.18 mosquitto compiled from source code. I haven't caught your problem.
It seems this problem is caused by the write permission on your dynamic-security.json. You can try to set the mosquitto runtime user to root evaluate this problem. Another possible way is to use chown mosquitto:mosquitto /etc/mosquitto/dynamic-security.json .
Hope that helps.

@yobyot
Copy link
Author

yobyot commented Nov 6, 2023

Thanks, @mrchipset.

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

No branches or pull requests

2 participants