From e101c6040d2aea23e7f8eda876a7154575e5af3e Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Mon, 3 Oct 2022 14:17:37 +0200 Subject: [PATCH] unbound: maintain a consistent dnsbl cache state In situations where a cache does not exist (mainly boot), a start/stop/restart of unbound should make the system aware of the current dnsbl configuration in order to properly diff on it. This includes unbound starting on boot. --- src/etc/inc/plugins.inc.d/unbound.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc index 7e020484d..bfdacee4b 100644 --- a/src/etc/inc/plugins.inc.d/unbound.inc +++ b/src/etc/inc/plugins.inc.d/unbound.inc @@ -379,6 +379,8 @@ function unbound_configure_do($verbose = false, $unused = '') } } + copy('/usr/local/etc/unbound.opnsense.d/dnsbl.conf', '/tmp/unbound_dnsbl.cache'); + mwexecf_bg('/usr/local/bin/flock -n -E 0 -o /tmp/unbound_start.lock /usr/local/opnsense/scripts/unbound/start.sh %s', [$domain]); if ($verbose) {