Conversation
|
This looks right, and I would like to take it. Reading pfSense CE source: One thing I would like before merge, and I am happy to fold it in myself if you would rather not push again. The new README test record opens with the FreeBSD 16 amd64 package having been run on Plus 26.07, but Two smaller things that can follow afterwards. The README should say that This does not depend on the builder question in #157 and should not wait for it. Could you take it out of draft? |
Symptom: on pfSense Plus 26.07 amd64, fips-dns-setup wrote the .fips forward-zone into the DNS Resolver custom options, config.xml and the regenerated /var/unbound/unbound.conf both carried it, and the helper reported "DNS Resolver updated and restarted" — but `drill <npub>.fips` through unbound answered NXDOMAIN, and `unbound-control lookup` showed the query still going to the root servers. The daemon answered the same query directly. fips-dns-teardown had the mirror problem: the block was gone from the file while the running resolver kept forwarding. Root cause: the helper called sync_unbound_service(), which regenerates unbound.conf and then only *starts* unbound, a no-op while an instance is already running, so the running resolver never saw the new file. Fix: call services_unbound_configure(), which is what the GUI's Apply runs (services_unbound.php): it TERMs the running unbound, waits, and starts it on the regenerated configuration. Verified on the same VM: teardown and setup each produce a new unbound pid, `unbound-control lookup` reports "forwarding request", and the full chain answers NOERROR; after a reboot the block is regenerated from config.xml and the chain still answers. Regression check: check-pfsense-pkg.sh now asserts, statically, that the shipped helper calls services_unbound_configure() and not sync_unbound_service(); the call itself needs pfSense's includes and cannot run in CI. The README's test record gains the Plus 26.07 amd64 VM run that found this.
59cea4d to
6777a00
Compare
|
Done, in the same commit: the README test record now says the FreeBSD 16 amd64 package was built outside |
fix(pfsense): restart unbound after editing the DNS Resolver options
Symptom. On pfSense Plus 26.07-RELEASE amd64 (KVM VM, Netgate
installer),
fips-dns-setupwrote the.fipsblock,config.xmland theregenerated
/var/unbound/unbound.confboth carried it, and the helperprinted "DNS Resolver updated and restarted". Yet
drill <npub>.fips @127.0.0.1 AAAAthrough unbound answered NXDOMAINwhile the same query straight at the daemon (
-p 5354) answered the AAAA,and
unbound-control lookup <npub>.fipsshowed the query going to theroot servers.
fips-dns-teardownhad the mirror problem: block gone fromthe file, running resolver still forwarding.
Root cause. The helper called
sync_unbound_service(). On thisrelease (and, from its shape, earlier ones) that function regenerates
unbound.confand then callsstart, which is a no-op while unbound isalready running. The running resolver never saw the new file. The unbound
log confirmed it: no restart after the config change, same pid throughout.
Fix. Call
services_unbound_configure(), which is what the GUI'sApply runs from
services_unbound.php: it TERMs the running unbound,waits for it to exit, and starts it on the regenerated configuration.
require_once("services.inc")added for it. The comment above the callnow says why it has to be this function.
Verified on the same VM, with the patched helper copied over the
installed one:
fips-dns-setupfips-dns-teardownconfig.xml; one daemon; chain answers NOERRORRegression check.
check-pfsense-pkg.shnow asserts statically thatthe shipped helper calls
services_unbound_configure()and notsync_unbound_service(), with the reason in the check's comment. Thecall itself needs pfSense's includes and cannot run in CI; the check
fails on the previous helper and passes on this one. A runtime test would
need a pfSense host, which is the same gap the README describes.
README. The test record now includes the Plus 26.07 amd64 VM run that
found this: install smoke, boot script lifecycle, the WAN-event reload
path, reboot, teardown and
pkg delete, and what the VM did not cover(mesh traffic, TUN under pf, CE itself). The paragraph saying no amd64
package had ever been installed is replaced accordingly.
The aarch64 hardware run on 26.03.1 reported
.fipsresolving throughunbound. I cannot say now whether unbound had been restarted by something
else on that box in between; the code path was the same.