Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound reporting: stops when a static lease is modified/added/removed #6402

Closed
2 tasks done
Christophe999s opened this issue Mar 7, 2023 · 7 comments
Closed
2 tasks done
Assignees
Labels
bug Production bug
Milestone

Comments

@Christophe999s
Copy link

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Unbound reporting stops when a static dhcp lease is modified/added/removed

To Reproduce

Change static dhcp lease
Check unbound reporting

Workaround
Reporting starts again when going into Reporting > Settings and clicking the Save button on Unbound DNS reporting

Screenshots
General
Reporting

Additional context
Thread on OPNsense forum:
https://forum.opnsense.org/index.php?topic=32161.0

Software version used and hardware type if relevant, e.g.:

OPNsense 23.1.1_2-amd64
FreeBSD 13.1-RELEASE-p6
OpenSSL 1.1.1t 7 Feb 2023
Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz (4 cores, 4 threads)
Running in Proxmox VM

@AdSchellevis
Copy link
Member

Looks like the HUP command kills the pipe between both processes and isn't reopened:

'hosts' => array('unbound_hosts_generate:0'),

killbypid('/var/run/unbound.pid', 'HUP');

@AdSchellevis AdSchellevis added the bug Production bug label Mar 7, 2023
@fichtner
Copy link
Member

fichtner commented Mar 7, 2023

It might be better to replace the HUP, as it forces unbound to do a complete reload and possibly purging the cache as well (without being able to retain it).

@fichtner fichtner added this to the 23.7 milestone Mar 7, 2023
@swhite2
Copy link
Member

swhite2 commented Mar 7, 2023

It's the only part of the code not following the strict restart logic, we can either attempt to reconnect from the logger (which closes itself as soon as Unbound stops), or indeed call unbound_configure_do()

@swhite2
Copy link
Member

swhite2 commented Mar 7, 2023

5f5be7c if @AdSchellevis agrees.

@fichtner
Copy link
Member

fichtner commented Mar 7, 2023

TBH, the whole 'hosts' logic can be removed and dns restart be issued instead:

% git grep unbound_hosts_generate
src/etc/inc/plugins.inc.d/unbound.inc:        'hosts' => array('unbound_hosts_generate:0'),
src/etc/inc/plugins.inc.d/unbound.inc:function unbound_hosts_generate()
% git grep 'plugin.*hosts'       
src/www/services_dhcp.php:    plugins_configure('hosts');
src/www/services_dhcpv6.php:    plugins_configure('hosts');

@fichtner
Copy link
Member

fichtner commented Mar 7, 2023

(the same applies to dnsmasq where HUP works, but how often are host overrides edited in batch anyway)

fichtner added a commit that referenced this issue Mar 7, 2023
@fichtner
Copy link
Member

fichtner commented Mar 7, 2023

Should be taken care of then. Not before 23.1.3.

@fichtner fichtner closed this as completed Mar 7, 2023
fichtner added a commit that referenced this issue Mar 14, 2023
(cherry picked from commit 11b6708)
(cherry picked from commit 481db99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

4 participants