]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: have daemons call frr_fini() at termination 6570/head
authorMark Stapp <mjs@voltanet.io>
Thu, 11 Jun 2020 15:16:02 +0000 (11:16 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 11 Jun 2020 19:41:52 +0000 (15:41 -0400)
Fix a number of library and daemon issues so that daemons can
call frr_fini() during normal termination. Without this,
temporary logging files are left behind in /var/tmp/frr/.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/thread.c
ospfd/ospf_main.c
ospfd/ospfd.c
pbrd/pbr_main.c
sharpd/sharp_main.c
staticd/static_main.c
vrrpd/vrrp_main.c

index 4d689a9f88a9e6a5aca5c2123aa5b863d11d54d8..9b2f5661acc12a88827ec9723cb74c62c04a8220 100644 (file)
@@ -1094,7 +1094,8 @@ static void do_thread_cancel(struct thread_master *master)
        }
 
        /* Delete and free all cancellation requests */
-       list_delete_all_node(master->cancel_req);
+       if (master->cancel_req)
+               list_delete_all_node(master->cancel_req);
 
        /* Wake up any threads which may be blocked in thread_cancel_async() */
        master->canceled = true;
index 6a3ba9902d50dcffc8f7aeb821f18ccd32caff9b..0a93d5d37c3b1657f99f368bf288b60cd6b33437 100644 (file)
@@ -98,6 +98,7 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
        ospf_terminate();
+       exit(0);
 }
 
 /* SIGUSR1 handler. */
index e9f622d217ade8328cbe572d87ab98866126e9f4..cdfcaa44d6793ffc2a4602231b8bae47d5ea5d31 100644 (file)
@@ -517,9 +517,9 @@ void ospf_terminate(void)
 
        SET_FLAG(om->options, OSPF_MASTER_SHUTDOWN);
 
-       /* exit immediately if OSPF not actually running */
+       /* Skip some steps if OSPF not actually running */
        if (listcount(om->ospf) == 0)
-               exit(0);
+               goto done;
 
        bfd_gbl_exit();
        for (ALL_LIST_ELEMENTS(om->ospf, node, nnode, ospf))
@@ -543,6 +543,7 @@ void ospf_terminate(void)
        zclient_stop(zclient);
        zclient_free(zclient);
 
+done:
        frr_fini();
 }
 
index b228847f06036f4ad4ba26b1dd31a1bfc50668b7..1dbe12a039c835005eb5047c29baf0bcb4f823fc 100644 (file)
@@ -82,6 +82,8 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
 
+       frr_fini();
+
        exit(0);
 }
 
index 120d7049189e1accb871242c6ec3941e732cb4ce..97a63e871ea3f724332715de399e49e51fdd5963 100644 (file)
@@ -81,6 +81,8 @@ static void sigint(void)
 {
        zlog_notice("Terminating on signal");
 
+       frr_fini();
+
        exit(0);
 }
 
index c77a99f28049d1386e35c749b2229005c4ff90bd..8356876f8e0268cee74b5708144f60245e536a90 100644 (file)
@@ -42,6 +42,7 @@ char backup_config_file[256];
 
 bool mpls_enabled;
 
+
 zebra_capabilities_t _caps_p[] = {
 };
 
@@ -75,6 +76,8 @@ static void sigint(void)
 
        static_vrf_terminate();
 
+       frr_fini();
+
        exit(0);
 }
 
index 95b3cfad8f1e8b59538707857401277d030023ea..b214b623de1e89cb0841ec3e4673764ce9b8ee1e 100644 (file)
@@ -82,6 +82,8 @@ static void __attribute__((noreturn)) sigint(void)
 
        vrrp_fini();
 
+       frr_fini();
+
        exit(0);
 }