net/mosquitto: chown data directory
authorKarl Palsson <karlp@etactica.com>
Tue, 30 Aug 2016 11:39:46 +0000 (11:39 +0000)
committerKarl Palsson <karlp@etactica.com>
Tue, 30 Aug 2016 11:41:34 +0000 (11:41 +0000)
The package creates a "mosquitto" user, but the support added for
persistence creates the data directory as root running the init script.
Properly chown the newly created directory to ensure it's writable.

Signed-off-by: Karl Palsson <karlp@etactica.com>
net/mosquitto/files/etc/init.d/mosquitto

index 56419088242dfbd1ae10f756805e9bcddc5f2972..adb31a397b176f561e1b5f53584b7c113da46f38 100755 (executable)
@@ -76,7 +76,10 @@ convert_persistence() {
        append_if "$cfg" file persistence_file
        config_get loc "$cfg" location
        if [ -n "$loc" ]; then
-               [ -d "$loc" ] || mkdir -p "$loc";
+               [ -d "$loc" ] || {
+                       mkdir -p "$loc";
+                       chown mosquitto "$loc";
+               }
                echo "persistence_location $loc" >> $TCONF
        fi
 }