]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
better #219 fix.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 11 Dec 2008 08:14:22 +0000 (08:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 11 Dec 2008 08:14:22 +0000 (08:14 +0000)
git-svn-id: file:///svn/unbound/trunk@1386 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/unbound.c
doc/Changelog
util/log.c

index 1a76fb2af97775e886a743c66d1edefa07c62419..1083aed131103dabd1c55cd6cc719f587c4bff34 100644 (file)
@@ -345,8 +345,6 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
         * 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
index aed6138f02645a7bcf2ce7abe5f308e2c3420c52..9266a3be09facb583bc8bd98e74c1ca035280659 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 9474504a0eca80ffa05b7055785caf5954cf5d4b..429610e0948ab4d015ec87b72b3f481833cb9966 100644 (file)
@@ -95,7 +95,9 @@ log_init(const char* filename, int use_syslog, const char* chrootdir)
                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;
        }