mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user