unbound: fix hotplug iface and ntp restarts

Unbound is configured to restart on hotplug/iface but this can result
in numerous restarts at boot. Unbound also has a restart for NTP.
This was observed to generate trouble and even with procd robustness
too many crashes might occur (rare). Unbound would not be running.

Give more care to /var/lib/unbound/root.key during restarts. Use procd
for iface restarts. Check pidof() to wait one more second for Unbound.

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
This commit is contained in:
Eric Luehrsen
2017-03-17 22:45:47 -04:00
parent 0fcdd8d84d
commit afa56a6002
4 changed files with 16 additions and 30 deletions

View File

@@ -20,6 +20,9 @@ PROG=/usr/sbin/unbound
##############################################################################
start_service() {
# WAIT! Unbound often takes its time writing closure stats to syslog
pidof $PROG && sleep 1
# complex UCI work
unbound_start
@@ -39,7 +42,8 @@ stop_service() {
##############################################################################
service_triggers() {
procd_add_reload_trigger "dhcp" "network" "unbound"
procd_add_reload_trigger "unbound"
procd_add_raw_trigger "interface.*" 2000 /etc/init.d/unbound restart
}
##############################################################################