From 37c303a6ac898bc9978970e5d8d7c5dfeabcf3a5 Mon Sep 17 00:00:00 2001 From: sem Date: Thu, 18 Dec 2008 15:41:14 +0000 Subject: - Fix reopening log after SIGHUP --- dns/unbound/Makefile | 1 + dns/unbound/files/patch-daemon-unbound.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 dns/unbound/files/patch-daemon-unbound.c (limited to 'dns/unbound') diff --git a/dns/unbound/Makefile b/dns/unbound/Makefile index e2713c174d3e..e033b82e39d6 100644 --- a/dns/unbound/Makefile +++ b/dns/unbound/Makefile @@ -7,6 +7,7 @@ PORTNAME= unbound PORTVERSION= 1.1.1 +PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= http://unbound.net/downloads/ diff --git a/dns/unbound/files/patch-daemon-unbound.c b/dns/unbound/files/patch-daemon-unbound.c new file mode 100644 index 000000000000..65744c811fbb --- /dev/null +++ b/dns/unbound/files/patch-daemon-unbound.c @@ -0,0 +1,24 @@ +--- daemon/unbound.c.orig 2008-11-20 12:48:36.000000000 +0300 ++++ daemon/unbound.c 2008-12-18 17:36:58.000000000 +0300 +@@ -345,8 +345,6 @@ + * 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 @@ + 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); + -- cgit