Skip to content

Commit 0500615

Browse files
committed
20211220 mosquitto-selfRepair-logging - master branch - PR 1 of 3
Following a suggestion from @ukkopahis, this pull request proposes logging self-repair activities. Guard messages make it clear when self-repair begins and ends: ``` [IOTstack] begin self-repair … [IOTstack] end self-repair ``` Between the guard messages: * `-v` option added to `rsync` * `-c` option added to `chown` These cause the respective processes to log any changes they make to persistent storage. Example. Assume `config/filter.acl` has been deleted and ownership of the `pwfile` folder and its contents has been changed to "pi:pi". Self-repair needs to restore `filter.acl` and restore the ownership to "1883:1883": ``` [IOTstack] begin self-repair sending incremental file list ./ config/ config/filter.acl pwfile/ sent 326 bytes received 50 bytes 752.00 bytes/sec total size is 1,077 speedup is 2.86 changed ownership of '/mosquitto/pwfile/pwfile' to 1883:1883 [IOTstack] end self-repair ``` Signed-off-by: Phill Kelley <[email protected]>
1 parent f876d33 commit 0500615

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.templates/mosquitto/docker-entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ set -e
55
user="$(id -u)"
66
if [ "$user" = '0' -a -d "/mosquitto" ]; then
77

8-
rsync -arp --ignore-existing /${IOTSTACK_DEFAULTS_DIR}/ "/mosquitto"
8+
echo "[IOTstack] begin self-repair"
99

10-
chown -R mosquitto:mosquitto /mosquitto
10+
rsync -arpv --ignore-existing /${IOTSTACK_DEFAULTS_DIR}/ "/mosquitto"
11+
12+
chown -Rc mosquitto:mosquitto /mosquitto
13+
14+
echo "[IOTstack] end self-repair"
1115

1216
fi
1317

0 commit comments

Comments
 (0)