]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix startup a bit more
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Sep 2016 20:01:27 +0000 (16:01 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Sep 2016 20:01:27 +0000 (16:01 -0400)
There were several issues here.  The zprivs_init is being
called *before* the cli is read in to influence the user
we are running as.  This needs to be rectified.  Additionally
we need to move the log creation till after cli arguments
are read.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_main.c

index 20fa138ce89b53aa849f586ba910aeeae5fd7707..54e732977247391bf9864072c5607d55308ec391 100644 (file)
@@ -415,13 +415,6 @@ main (int argc, char **argv)
   /* Preserve name of myself. */
   progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
 
-  zlog_default = openzlog (progname, ZLOG_BGP, 0,
-                          LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
-  zprivs_init (&bgpd_privs);
-#if defined(HAVE_CUMULUS)
-  zlog_set_level (NULL, ZLOG_DEST_SYSLOG, zlog_default->default_lvl);
-#endif
-
   /* BGP master init. */
   bgp_master_init ();
 
@@ -502,6 +495,12 @@ main (int argc, char **argv)
        }
     }
 
+  zlog_default = openzlog (progname, ZLOG_BGP, 0,
+                          LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
+  zprivs_init (&bgpd_privs);
+#if defined(HAVE_CUMULUS)
+  zlog_set_level (NULL, ZLOG_DEST_SYSLOG, zlog_default->default_lvl);
+#endif
 
   /* Initializations. */
   srandom (time (NULL));