From e8f0b35308abbd359741c7d0b5db363a5cbe7d5b Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Thu, 22 Sep 2016 17:29:20 +0200 Subject: [PATCH] [reload-config] Log which services have been reloaded --- openwisp-config/files/sbin/openwisp-reload-config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openwisp-config/files/sbin/openwisp-reload-config b/openwisp-config/files/sbin/openwisp-reload-config index ba53fc0..5a937db 100755 --- a/openwisp-config/files/sbin/openwisp-reload-config +++ b/openwisp-config/files/sbin/openwisp-reload-config @@ -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