summaryrefslogtreecommitdiff
path: root/package/system
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-07-11 17:00:54 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-07-11 17:00:54 +0000
commit157601b6948adc50efe73f9ee76bcd9cc46c0122 (patch)
treea2490dc7b2010b1179ec5111b09ec47b4168fbad /package/system
parent271bb7ef0ea4d4a4be311048db029fffdf2695bf (diff)
procd: add a small script that handles config reloads until configd is ready
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37248 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system')
-rw-r--r--package/system/procd/Makefile1
-rw-r--r--package/system/procd/files/procd.sh3
-rw-r--r--package/system/procd/files/reload_config8
3 files changed, 12 insertions, 0 deletions
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 27879e8443..b91af98146 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -32,6 +32,7 @@ define Package/procd/install
$(INSTALL_DIR) $(1)/sbin $(1)/lib/functions $(1)/etc/init.d
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/{procd,askfirst,udevtrigger,logread} $(1)/sbin/
+ $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
$(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log
$(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
$(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index b706b1e97d..096eb2de32 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -67,6 +67,9 @@ _procd_open_service() {
_procd_close_service() {
json_close_object
+ _procd_open_trigger
+ service_triggers
+ _procd_close_trigger
_procd_ubus_call set
}
diff --git a/package/system/procd/files/reload_config b/package/system/procd/files/reload_config
new file mode 100644
index 0000000000..ef8ab87e0c
--- /dev/null
+++ b/package/system/procd/files/reload_config
@@ -0,0 +1,8 @@
+#!/bin/sh
+MD5FILE=/var/run/config.md5
+[ -f $MD5FILE ] && {
+ for c in `md5sum -c $MD5FILE 2>/dev/null| grep FAILED | cut -d: -f1`; do
+ ubus call service event "{ \"type\": \"config.change\", \"data\": { \"package\": \"$(basename $c)\" }}"
+ done
+}
+md5sum /etc/config/* > $MD5FILE