diff --git a/daemon/unbound.c b/daemon/unbound.c index a25132945..1bd79cb00 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -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 */ diff --git a/doc/Changelog b/doc/Changelog index 3af9f647c..c586c1d1c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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.