* a fork error could not be printed since daemonize closed stderr.*/
if(cfg->use_syslog) {
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
- /* but syslog is not really opened by glibc until first msg */
- log_info("open syslog, startup in progress");
}
/* if using a logfile, we cannot open it because the logfile would
* be created with the wrong permissions, we cannot chown it because
+11 December 2008: Wouter
+ - better fix for bug #219: use LOG_NDELAY with openlog() call.
+ Thanks to Tamas Tevesz.
+
9 December 2008: Wouter
- bug #221 fixed: unbound checkconf checks if key files exist if
remote control is enabled. Also fixed NULL printf when not chrooted.
logging_to_syslog = 0;
}
if(use_syslog) {
- openlog(ident, 0, LOG_DAEMON);
+ /* do not delay opening until first write, because we may
+ * chroot and no longer be able to access dev/log and so on */
+ openlog(ident, LOG_NDELAY, LOG_DAEMON);
logging_to_syslog = 1;
return;
}