diff options
author | paulo <paul@bayleaf.org.uk> | 2009-12-18 16:48:20 +0000 |
---|---|---|
committer | paulo <paul@bayleaf.org.uk> | 2009-12-18 16:48:20 +0000 |
commit | 1a88dd5744496aaf1fe5c2d4a859cae0612fdff3 (patch) | |
tree | 3dda7a4c2d4eddbd2b3a2c3f873d8015aded6362 /bgpd/bgp_main.c | |
parent | bb48a82760858f94e7d2ce767ee61d98be2ee071 (diff) | |
download | quagga-1a88dd5744496aaf1fe5c2d4a859cae0612fdff3.tar.bz2 quagga-1a88dd5744496aaf1fe5c2d4a859cae0612fdff3.tar.xz |
QDEBUG handling. Debug banner on stderr, vty and log file. Annouce
before and after reading config file. Announce on all vty when shutting
down.
Diffstat (limited to 'bgpd/bgp_main.c')
-rw-r--r-- | bgpd/bgp_main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 1be1d77c..4b030db5 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -202,6 +202,9 @@ sighup (void) void sigint (void) { +#ifdef QDEBUG + vty_goodbye(); +#endif zlog_notice ("Terminating on signal"); if (! retain_mode) @@ -354,6 +357,10 @@ main (int argc, char **argv) /* Set umask before anything for security */ umask (0027); +#ifdef QDEBUG + fprintf(stderr, "%s\n", debug_banner); +#endif + qlib_init_first_stage(); /* Preserve name of myself. */ @@ -472,6 +479,13 @@ main (int argc, char **argv) zlog_err("BGPd daemon failed: %s", strerror(errno)); return (1); } +#ifdef QDEBUG + if (daemon_mode) + { + fprintf(stderr, "BGPd daemonised\n"); + zlog_notice("BGPd daemonised"); + } +#endif /* Process ID file creation. */ pid_output (pid_file); @@ -491,10 +505,14 @@ main (int argc, char **argv) vty_serv_sock (vty_addr, vty_port, BGP_VTYSH_PATH); /* Print banner. */ +#ifdef QDEBUG + zlog_notice("%s", debug_banner); +#endif zlog_notice ("BGPd %s starting: vty@%d, bgp@%s:%d", QUAGGA_VERSION, vty_port, (bm->address ? bm->address : "<all>"), - bm->port); + (int)bm->port); + /* Launch finite state machines */ if (qpthreads_enabled) |