diff options
author | Eric Luehrsen <ericluehrsen@hotmail.com> | 2017-03-25 01:53:28 -0400 |
---|---|---|
committer | Eric Luehrsen <ericluehrsen@hotmail.com> | 2017-03-26 02:05:46 -0400 |
commit | e6520cf249ccf403a6bc548b7735615f13280212 (patch) | |
tree | 5cd5fd70d87ead35cd987ad75eca28a4062ed7e2 /net/unbound/files/unbound.init | |
parent | fb199062a67c374c917d5f34a8c4e0acae92cfb9 (diff) |
unbound: improve interface trigger behavior
procd interface triggers may be busy. Unbound hard restarts will
flush the cache. This might happen frequently depending on how
interface triggers occur.
Change the procd trigger to reduce occurences. Load this trigger
prior to netifd (START=20), but only truly start Unbound from
the trigger rather than immediately in init. Clean up log entries
in scripts after Unbound, NTP, and DNSSEC are established.
Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
Diffstat (limited to 'net/unbound/files/unbound.init')
-rwxr-xr-x | net/unbound/files/unbound.init | 22 |
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 } ############################################################################## |