diff options
author | Eric Luehrsen <ericluehrsen@gmail.com> | 2018-07-31 22:59:24 -0400 |
---|---|---|
committer | Eric Luehrsen <ericluehrsen@gmail.com> | 2018-08-03 03:27:03 -0400 |
commit | 8830d72bbd8882b89a9d42047c31088ac8e76265 (patch) | |
tree | fac06dd0bb6a5217b65c6751e7f75838e78f8440 /net/unbound/files/unbound.init | |
parent | 74c043276a59315d030ee78864db0148ffa45e1b (diff) |
unbound: fix boot time and default run directory
Unbound struggles with boot ifup, so procd triggers changed to push
outside of this noise. Unbound has run in /var/lib/unbound/, so chroot
(jail) protects /etc/, and it can save flash wear. Compiled defaults
reflect this now, so Unbound tools are easier run on the command line.
Signed-off-by: Eric Luehrsen <ericluehrsen@gmail.com>
Diffstat (limited to 'net/unbound/files/unbound.init')
-rwxr-xr-x | net/unbound/files/unbound.init | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/net/unbound/files/unbound.init b/net/unbound/files/unbound.init index f12e6831c..ff827c4f0 100755 --- a/net/unbound/files/unbound.init +++ b/net/unbound/files/unbound.init @@ -54,22 +54,31 @@ stop_service() { ############################################################################## service_triggers() { - local trigger local legacy=$( uci_get unbound.@unbound[0].trigger ) local triggers=$( uci_get unbound.@unbound[0].trigger_interface ) + local trigger="$triggers $legacy" - triggers="$triggers $legacy" - PROCD_RELOAD_DELAY=2000 - procd_add_reload_trigger "unbound" + . /usr/lib/unbound/defaults.sh + + + if [ ! -f "$UB_TOTAL_CONF" -o -n "$UB_BOOT" ] ; then + # Unbound is can be a bit heavy, so wait some on first start but any + # interface coming up affects the trigger and delay so guarantee start + procd_add_raw_trigger "interface.*.up" 5000 /etc/init.d/unbound restart + + elif [ -n "$triggers" ] ; then + PROCD_RELOAD_DELAY=2000 + procd_add_reload_trigger "unbound" "dhcp" - if [ -n "$triggers" ] ; then for trigger in $triggers ; do - # due to some netifd/procd interactions with IP6, limit interfaces + # User selected triggers to restart at any other time procd_add_reload_interface_trigger "$trigger" done + else - procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload + PROCD_RELOAD_DELAY=2000 + procd_add_reload_trigger "unbound" "dhcp" fi } |