aboutsummaryrefslogtreecommitdiff
path: root/net/unbound/files/unbound.init
diff options
context:
space:
mode:
Diffstat (limited to 'net/unbound/files/unbound.init')
-rwxr-xr-xnet/unbound/files/unbound.init22
1 files changed, 18 insertions, 4 deletions
diff --git a/net/unbound/files/unbound.init b/net/unbound/files/unbound.init
index e4b7ec85f..1edf9ef80 100755
--- a/net/unbound/files/unbound.init
+++ b/net/unbound/files/unbound.init
@@ -9,7 +9,8 @@
#
##############################################################################
-START=60
+START=19
+STOP=50
USE_PROCD=1
PROG=/usr/sbin/unbound
@@ -19,9 +20,18 @@ PROG=/usr/sbin/unbound
##############################################################################
+boot() {
+ UNBOUND_BOOT=1
+ start "$@"
+}
+
+##############################################################################
+
start_service() {
- # WAIT! Unbound often takes its time writing closure stats to syslog
- pidof $PROG && sleep 1
+ if [ -n "$UNBOUND_BOOT" ] ; then
+ # Load procd triggers (rc) and use event IFUP to really start
+ return 0
+ fi
# complex UCI work
unbound_start
@@ -37,13 +47,17 @@ start_service() {
stop_service() {
unbound_stop
+
+ # Wait! on restart Unbound may take time writing closure stats to syslog
+ pidof $PROG && sleep 1
}
##############################################################################
service_triggers() {
+ # use soft reload to prevent continuous stop-start and cache flush
procd_add_reload_trigger "unbound"
- procd_add_raw_trigger "interface.*" 2000 /etc/init.d/unbound restart
+ procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
}
##############################################################################