Bugzilla – Bug 219
syslog socket is opened after chroot
Last modified: 2008-12-11 09:16:35 CET
Syslog socket is opened after chroot(2) call thus /dev/log socket has to exist inside chroot. Better will be open syslog socket before chroot.
openlog() function is called before chroot() but GNU libc opens syslog socket "ondemand" so socket is not opened before first syslog() call. Current scenario:
so log is not opened if /dev/log doesn't exist in chroot. Attached patch fixes the problem - starting message is logged before chroot().
This bug is similar to http://www.nlnetlabs.nl/bugs/show_bug.cgi?id=199
Both 1.0.2 and 1.1.0 versions have this problem
Created attachment 92 [details]
I did not know that it was opened on demand.
Thank you for the report and patch.
created 1.1.0 version tag.
Fixed as you suggest.
Did not remove the 'start of service' message. It is as close as possible to where service is really available. It is printed when sockets are opened, and service is either already available from other threads, or is the very next thing to happen.
A new message is printed to open the syslog, only when using syslog().
unbound: [30522:0] info: open syslog, startup in progress
Thanks much, I looked into SVN and patch looks fine
Fixed using LOG_NDELAY, patch thanks to Tamas Tevesz.