Skip to content

Commit

Permalink
[init.d] Ensure control file is removed
Browse files Browse the repository at this point in the history
Ensure /tmp/openwisp/applying_conf is removed to avoid
unpredictable behaviour.
  • Loading branch information
nemesifier committed May 12, 2016
1 parent 6776271 commit e0d4efc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openwisp-config/files/openwisp.init
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@ reload_service() {
logger -s "$PROG_NAME received reload trigger" \
-t openwisp \
-p daemon.info
local control_file=/tmp/openwisp/applying_conf
# avoid reloading while configuration is being applied
# will wait for a maximum of 30 seconds
for i in $(seq 1 30); do
if [ -f "/tmp/openwisp/applying_conf" ]; then
if [ -f $control_file ]; then
sleep 1
else
break
fi
done
# ensure control file is removed
rm $control_file
# reload
start
}

0 comments on commit e0d4efc

Please sign in to comment.