Skip to content

Commit

Permalink
[reload-config] Log which services have been reloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Sep 22, 2016
1 parent cded6cc commit e8f0b35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openwisp-config/files/sbin/openwisp-reload-config
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ if [ -f $MD5FILE ]; then
local is_registered=$(ubus call service list "{\"name\": \"$service\"}" | grep -c $service)
# try reloading service via ubus
ubus call service event "{ \"type\": \"config.change\", \"data\": { \"package\": \"$service\" }}"
local logger_msg="Service $service has been reloaded via procd/ubus"
# if init.d file exists and service is not registerd in procd do explicit reload
if [ -f $initd ] && [ $is_registered -lt 1 ]; then
$initd reload
local logger_msg="Service $service has been reloaded via init.d script"
fi
# log which service has been reloaded and how
logger $logger_msg -t openwisp -p daemon.info
done
fi
md5sum /var/run/config.check/* > $MD5FILE
Expand Down

0 comments on commit e8f0b35

Please sign in to comment.