mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
logfile creation fixup.
git-svn-id: file:///svn/unbound/trunk@1214 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
21cd9936d8
commit
51d548563c
2 changed files with 11 additions and 9 deletions
|
|
@ -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.*/
|
* a fork error could not be printed since daemonize closed stderr.*/
|
||||||
if(cfg->use_syslog)
|
if(cfg->use_syslog)
|
||||||
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
|
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
|
||||||
else if(cfg->logfile && cfg->logfile[0]) {
|
/* if using a logfile, we cannot open it because the logfile would
|
||||||
/* open logfile temporary with root permissions, to log
|
* be created with the wrong permissions, we cannot chown it because
|
||||||
* errors happening after daemonizing, that closes stderr.
|
* we cannot chown system logfiles, so we do not open at all.
|
||||||
* After all that we reopen the logfile with less permits. */
|
* So, using a logfile, the user does not see errors unless -d is
|
||||||
char* lf = fname_after_chroot(cfg->logfile, cfg, 1);
|
* given to unbound on the commandline. */
|
||||||
if(!lf) fatal_exit("logfile malloc: out of memory");
|
|
||||||
log_init(lf, 0, NULL);
|
|
||||||
free(lf);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_KILL
|
#ifdef HAVE_KILL
|
||||||
/* check old pid file before forking */
|
/* check old pid file before forking */
|
||||||
|
|
|
||||||
|
|
@ -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
|
27 August 2008: Wouter
|
||||||
- daemon(3) is causing problems for people. Reverting the patch.
|
- daemon(3) is causing problems for people. Reverting the patch.
|
||||||
bug#200, and 199 and 203 contain sideline discussion on it.
|
bug#200, and 199 and 203 contain sideline discussion on it.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue