Not recorded in syslog unless local-unbound is restarted unbound-1.14.0.pkg: # pkg install unbound # unbound-control-setup /var/log/console.log kernel: Starting local_unbound. kernel: Waiting for nameserver to start... good -- Unbound can not record log because syslogd has not started kernel: Updating /var/run/os-release done. kernel: Creating and/or trimming log files. kernel: Updating motd:. kernel: Starting syslogd. -- After that, even if syslogd starts, unbound does not reopen the log, so it will continue to fail # sockstat | grep unb unbound unbound 452 3 udp6 ::1:53 *:* unbound unbound 452 4 tcp6 ::1:53 *:* unbound unbound 452 5 udp4 127.0.0.1:53 *:* unbound unbound 452 6 tcp4 127.0.0.1:53 *:* unbound unbound 452 7 stream -> ?? unbound unbound 452 8 stream -> ?? # grep unbou /var/log/all.log kernel: Starting unbound. -- unbound cannot be recorded in syslog # service unbound restart Stopping unbound. Waiting for PIDS: 452. Obtaining a trust anchor... Starting unbound. # sockstat | grep unb unbound unbound 758 3 udp6 ::1:53 *:* unbound unbound 758 4 tcp6 ::1:53 *:* unbound unbound 758 5 udp4 127.0.0.1:53 *:* unbound unbound 758 6 tcp4 127.0.0.1:53 *:* unbound unbound 758 7 dgram -> /var/run/logpriv unbound unbound 758 8 stream -> ?? unbound unbound 758 9 stream -> ?? # grep unbou /var/log/all.log kernel: Starting unbound. kernel: Starting unbound. unbound[758]: [758:0] notice: init module 0: validator unbound[758]: [758:0] notice: init module 1: iterator unbound[758]: [758:0] info: start of service (unbound 1.14.0). -- unbound can be recorded in syslog Where is the best restert? local-unbound also cause the same problem (bug #262844)
x Not recorded in syslog unless local-unbound is restarted o Not recorded in syslog unless dns/unbound is restarted
Instead of a restart, you could do a "unbound-control log_reopen". See man 8 unbound-control for details
(In reply to Jaap Akkerhuis from comment #2) Confirmed fail. It is chrooted by default, so log_reopen does not solve the problem. man 8 unbound-contro log_reopen >(which may not work if chrooted). dns/unbound # unbound-checkconf -o chroot /usr/local/etc/unbound I'm not sure which script is appropriate to patch to fix the problem of not logging. /etc/rc.d/syslogd ? create /etc/rc.d/unbound-shyslog ? Other mechanisms?
Just restart the daemon fixes it. You can always try to complain to upstairs about unbound-control not matching expectations.
The following script could handle it -- /usr/local/etc/rc.d/unbound_syslog -- #!/bin/sh # PROVIDE: unbound_syslog # REQUIRE: unbound syslogd . /etc/rc.subr name="unbound_syslog" desc="unbound to use syslog" start_cmd="${name}_start" stop_cmd=":" load_rc_config "unbound" : ${unbound_enable:="NO"} : ${unbound_config:=/usr/local/etc/unbound/unbound.conf} checkconf="/usr/local/sbin/unbound-checkconf" unbound_syslog_start() { if checkyesno unbound_enable; then usesyslog=`${checkconf} -o use-syslog ${unbound_config}` if checkyesno usesyslog; then echo unbound restarts to use syslog /usr/sbin/service unbound restart fi fi } run_rc_command "$1"
(In reply to vfx9as from comment #5) There is such a thing, but please write the results of the rcorder here first :) rcorder /etc/rc.d/* My 12.3-STABLE results also had syslogd later than local_unbound, so it must not find it. ︙ /etc/rc.d/local_unbound /etc/rc.d/NETWORKING ︙ /etc/rc.d/syslogd ︙ I reverted back to bind because of the poor performance of unbound :)
(In reply to Tatsuki Makino from comment #6) local_unbound is at bug #262844 bug #262844 Comment #6 has rcorder results
Running syslog is the default for a system. It is not the function of unbound to enforce that so this is not a bug.
(In reply to Jaap Akkerhuis from comment #9) If unbound doesn't have the facilities available to satisfy it's needs. It is unbound' responsibility to complain && indicate that. --Chris
I have stumbled upon a similar, related problem. With the default configuration, after installing dns/unbound from ports, it won't log to syslogd because syslogd starts _after_ unbound is started. The fix is trivial, after adding syslogd to the REQUIRE section in /usr/local/etc/rc.d/unbound it works as expected.
(In reply to Borja Marcos from comment #11) See also rcorder(8) || start late. :-)
I'm not sure if it's part of the syslog issue, but the rc change in the 1.17.0 port causes unbound to be first in rcorder instead of the same time as local_unbound, (seen on 13.1-RELEASE-p5) moving the load_rc_config line back so it's ahead of the defaults fixed my issue link to the rc change: https://cgit.freebsd.org/ports/commit/?id=7b0d6de05baabfbcd7a25fd0440ee3bf1f3bc23e FWIW, re: syslog, on my FreeBSD 13.1 system, and skipping unrelated scripts: /etc/rc.d/syslogd /etc/rc.d/SERVERS /etc/rc.d/local_unbound /usr/local/etc/rc.d/unbound /etc/rc.d/NETWORKING So perhaps changes to syslogd or other rc files in base may have fixed the issue (assuming unbound from ports doesn't start first, like it did after upgrading)