openbsd-ports/net/unbound/patches/patch-daemon_unbound_c
jakob 5d8b62cb1c merge 2 patches from unbound trunk:
- fixup BSD port for infra host storage. It hashed wrongly.
- do not reopen syslog to avoid dev/log dependency.
2008-12-30 10:40:13 +00:00

26 lines
1.1 KiB
Plaintext

$OpenBSD: patch-daemon_unbound_c,v 1.3 2008/12/30 10:40:13 jakob Exp $
--- daemon/unbound.c.orig Thu Dec 18 22:53:27 2008
+++ daemon/unbound.c Thu Dec 18 22:54:57 2008
@@ -345,8 +345,6 @@ perform_setup(struct daemon* daemon, struct config_fil
* 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
@@ -516,7 +514,11 @@ run_daemon(const char* cfgfile, int cmdline_verbose, i
if(!done_setup) {
perform_setup(daemon, cfg, debug_mode, &cfgfile);
done_setup = 1;
- } else log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
+ } else {
+ /* reopen log after HUP to facilitate log rotation */
+ if(!cfg->use_syslog)
+ log_init(cfg->logfile, 0, cfg->chrootdir);
+ }
/* work */
daemon_fork(daemon);