Syslog and SIGHUP on FreeBSD

Hello unbound-users,

I'm using unbound on FreeBSD with syslog from FreeBSD ports. Query logs were
written in it when I started unbound first, but unbound didn't write any query
logs in it after I sent HUP to unbound with kill command. Unbound just wrote
"Restart of unbound 1.1.1.", never logs were written then.

I looked over some source files and found that unbound wrote query logs to
syslog when closelog() in util/log.c was commented out, but I don't know why
it did so. I don't have confidence whether this is correct. Does anyone solve
the same problem without touching source codes, or does this problem depend on
FreeBSD?

Thanks.

% uname -srm
FreeBSD 7.0-RC1 i386
(FreeBSD 6.4-RELEASE i386 is also occured)

% cat /usr/local/etc/unbound/unbound.conf
server:
        verbosity: 2
        interface: 0.0.0.0
        do-ip6: no
        access-control: 0.0.0.0/0 refuse
        access-control: 192.168.0.0/32 allow
        directory: ""
        logfile: ""
        use-syslog: yes
        root-hints: "/named.cache"

% cat /etc/syslog.conf
(snip)
!unbound
*.* /var/log/unbound.log

-- Atsushi

Hi Atsushi,

A fix is in svn trunk for unbound.

It no longer re-opens syslog, only if it logged to file does it reopen
the file to facilitate log rotation.

This makes it easier to deploy unbound. Previously, unbound needed a
dev/log link into the chroot environment.

Best regards,
   Wouter

Atsushi EZURA wrote:

I've just added the patch to the port.

W.C.A. Wijngaards wrote:

Hi Wouter and Sergey,

Thank you for your fixing.

I tried your patch from FreeBSD port. It works fine!
Thank you for your helping!

-- Atsushi

* W.C.A. Wijngaards <wouter@NLnetLabs.nl> [2008-12-18 23:39]:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Atsushi,

A fix is in svn trunk for unbound.

It no longer re-opens syslog, only if it logged to file does it reopen
the file to facilitate log rotation.

This makes it easier to deploy unbound. Previously, unbound needed a
dev/log link into the chroot environment.

Best regards,
   Wouter

* Sergey Matveychuk <sem@FreeBSD.org> [2008-12-19 00:42]: