]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
logfile creation fixup.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 28 Aug 2008 09:02:48 +0000 (09:02 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 28 Aug 2008 09:02:48 +0000 (09:02 +0000)
git-svn-id: file:///svn/unbound/trunk@1214 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/unbound.c
doc/Changelog

index a2513294522feee23cf3f12fb2e68255e3be16f3..1bd79cb003c875e56c873f7a01f442dbf0a93b67 100644 (file)
@@ -339,15 +339,11 @@ 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);
-       else if(cfg->logfile && cfg->logfile[0]) {
-               /* open logfile temporary with root permissions, to log
-                * errors happening after daemonizing, that closes stderr.
-                * After all that we reopen the logfile with less permits. */
-               char* lf = fname_after_chroot(cfg->logfile, cfg, 1);
-               if(!lf) fatal_exit("logfile malloc: out of memory");
-               log_init(lf, 0, NULL);
-               free(lf);
-       }
+       /* if using a logfile, we cannot open it because the logfile would
+        * be created with the wrong permissions, we cannot chown it because
+        * we cannot chown system logfiles, so we do not open at all.
+        * So, using a logfile, the user does not see errors unless -d is
+        * given to unbound on the commandline. */
 
 #ifdef HAVE_KILL
        /* check old pid file before forking */
index 3af9f647cb44d3c9d451cac871615a0267eae5a4..c586c1d1ca989492a48029cdfde87682f3cf5f32 100644 (file)
@@ -1,3 +1,9 @@
+28 August 2008: Wouter
+       - fixup logfile handling; it is created with correct permissions
+         again. (from bugfix#199).
+         Some errors are not written to logfile (pidfile writing, forking),
+         and these are only visible by using the -d commandline flag.
+
 27 August 2008: Wouter
        - daemon(3) is causing problems for people. Reverting the patch.
          bug#200, and 199 and 203 contain sideline discussion on it.