mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 12:09:22 +00:00
bgpd: Fix startup a bit more
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>
This commit is contained in:
parent
b8dfa54478
commit
03809024fd
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user