Skip to content

Commit

Permalink
* : extra logs for shutdown processing
Browse files Browse the repository at this point in the history
Adding extra logs for shutdown processing

Signed-off-by: Mark Stapp <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
Mark Stapp authored and donaldsharp committed Dec 7, 2024
1 parent 49ce5e7 commit 1b32c77
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ void sighup(void)
__attribute__((__noreturn__)) void sigint(void)
{
zlog_notice("Terminating on signal");
if (CHECK_FLAG(bm->flags, BM_FLAG_FAST_SHUTDOWN))

if (CHECK_FLAG(bm->flags, BM_FLAG_FAST_SHUTDOWN)) {
zlog_info("Fast-shutdown configured, exiting.");
exit(0);
}

assert(bm->terminating == false);
bm->terminating = true; /* global flag that shutting down */
Expand Down Expand Up @@ -187,6 +190,8 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
/* it only makes sense for this to be called on a clean exit */
assert(status == 0);

zlog_info("BGP exiting.");

frr_early_fini();

bgp_close();
Expand Down
2 changes: 2 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8621,6 +8621,8 @@ void bgp_terminate(void)
struct listnode *node, *nnode;
struct listnode *mnode, *mnnode;

zlog_info("BGP Terminating");

QOBJ_UNREG(bm);

/* Close the listener sockets first as this prevents peers from
Expand Down
2 changes: 2 additions & 0 deletions lib/libfrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,8 @@ void frr_fini(void)

hook_call(frr_fini);

zlog_info("FRR Fini");

vty_terminate();
cmd_terminate();
nb_terminate();
Expand Down
3 changes: 3 additions & 0 deletions lib/sigevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ int frr_sigevent_process(void)
#endif /* SIGEVENT_BLOCK_SIGNALS */

if (sigmaster.caught > 0) {

zlog_info("%s: calling daemon handlers", __func__);

sigmaster.caught = 0;
/* must not read or set sigmaster.caught after here,
* race condition with per-sig caught flags if one does
Expand Down
6 changes: 5 additions & 1 deletion zebra/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ static void sigint(void)
struct zserv *client;
static bool sigint_done;

if (zrouter.fast_shutdown)
zlog_info("Handling SIGINT");

if (zrouter.fast_shutdown) {
zlog_info("Fast-shutdown, exiting");
exit(0);
}

if (sigint_done)
return;
Expand Down

0 comments on commit 1b32c77

Please sign in to comment.