]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Print fatal errors about remote control setup before log init,
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Jan 2018 15:59:18 +0000 (15:59 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Jan 2018 15:59:18 +0000 (15:59 +0000)
  so that it is printed to console.

git-svn-id: file:///svn/unbound/trunk@4448 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/unbound.c
doc/Changelog

index 432aa912e681f6dd9941c22e7986d65d9466514a..10ab082e2158e919dcfb264b939e27dfe139a548 100644 (file)
@@ -421,17 +421,6 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
        w_config_adjust_directory(cfg);
 #endif
 
-       /* init syslog (as root) if needed, before daemonize, otherwise
-        * a fork error could not be printed since daemonize closed stderr.*/
-       if(cfg->use_syslog) {
-               log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
-       }
-       /* 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. */
-
        /* read ssl keys while superuser and outside chroot */
 #ifdef HAVE_SSL
        if(!(daemon->rc = daemon_remote_create(cfg)))
@@ -445,6 +434,17 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
                fatal_exit("could not set up connect SSL_CTX");
 #endif
 
+       /* init syslog (as root) if needed, before daemonize, otherwise
+        * a fork error could not be printed since daemonize closed stderr.*/
+       if(cfg->use_syslog) {
+               log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
+       }
+       /* 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
        /* true if pidfile is inside chrootdir, or nochroot */
        pidinchroot = need_pidfile && (!(cfg->chrootdir && cfg->chrootdir[0]) ||
index 9c3724007e6f8b816e97eee59fe9620317b1c5c0..865cd6714d3bd42e61d361c0ca669b095d2a06d1 100644 (file)
@@ -1,6 +1,8 @@
 23 January 2018: Wouter
        - Fix that unbound-checkconf -f flag works with auto-trust-anchor-file
          for startup scripts to get the full pathname(s) of anchor file(s).
+       - Print fatal errors about remote control setup before log init,
+         so that it is printed to console.
 
 22 January 2018: Wouter
        - Accept tls-upstream in unbound.conf, the ssl-upstream keyword is