Fix mosquitto data/log dir ownership for non-root container user
eclipse-mosquitto:2 runs as its own uid/gid 1883 and doesn't chown bind-mounted volumes itself, so the root-owned host dirs from mkdir -p left it unable to write its log file — broker was stuck restart-looping. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
705b3a0561
commit
7e9fe62e1c
1 changed files with 4 additions and 0 deletions
|
|
@ -1747,6 +1747,10 @@ deploy_mqtt_broker() {
|
|||
|
||||
msg_info "Deploying Mosquitto"
|
||||
pct exec 104 -- mkdir -p /opt/mqtt-broker/config /opt/mqtt-broker/data /opt/mqtt-broker/log
|
||||
# eclipse-mosquitto:2 runs as its own non-root 'mosquitto' user (uid/gid 1883)
|
||||
# and — unlike older images — no longer auto-chowns bind-mounted volumes, so
|
||||
# a host-created (root-owned) data/log dir leaves it unable to write either.
|
||||
pct exec 104 -- chown -R 1883:1883 /opt/mqtt-broker/data /opt/mqtt-broker/log
|
||||
|
||||
# Dynamic-security plugin, not static password/ACL files — lets per-consumer
|
||||
# clients be created/revoked live later (via mosquitto_ctrl or, eventually,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue