SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.42k stars 303 forks source link

2023-10-09 Mosquitto entry-point script - master branch - PR 1 of 2 #732

Closed Paraphraser closed 8 months ago

Paraphraser commented 8 months ago

The folder structure for a newly-created or self-repaired persistent store assumes ownership of id 1883 (which is "mosquitto" inside the container) and file/folder modes copied from the iotstack_defaults folder hierarchy.

Investigations during #731 revealed that Mosquitto now wants the password file to be owned by root with a mode of 600.

Although the mode requirement could be accommodated by changing the iotstack_defaults structure, the ownership requirement can't be met that way.

This fix adds the necessary chown and chmod commands to the entry-point script.

Noschvie commented 8 months ago

Hi @Paraphraser did a new installation from scratch, restored the backup from #731

pi@singerhaus:~/IOTstack $ sudo ls -lrt ./volumes/mosquitto/pwfile
total 4
-rw------- 1 root root 132 Oct 11 00:03 pwfile

Now the pwfile has other permissions, but mosquitto isn't starting. Maybe because of this changed ? "reset the password file" and "create username and password" doesn't work as before.

Paraphraser commented 8 months ago

I've just pushed an update to #734 to resolve this problem. We await the pleasure of @Slyke to get this applied.

If you need a workaround:

  1. Open ~/IOTstack/.templates/mosquitto/docker-entrypoint.sh in a text editor.
  2. Find the line chown -c root:root "$PWFILE" and delete it.
  3. Rebuild the container:

    $ cd ~/IOTstack
    $ docker-compose up -d --build mosquitto

Once this becomes available on GitHub, you'll need to revert the edited file:

$ cd ~/IOTstack/.templates/mosquitto
$ git restore docker-entrypoint.sh
$ git pull
Noschvie commented 8 months ago

Thanks for the workaround, works perfect!