From 7e9fe62e1c535ce9e2d7260b068cb709cd4487d8 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Tue, 28 Jul 2026 13:50:21 +0000 Subject: [PATCH] Fix mosquitto data/log dir ownership for non-root container user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- install-stack.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-stack.sh b/install-stack.sh index 426d1bb..d788e2d 100755 --- a/install-stack.sh +++ b/install-stack.sh @@ -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,