]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: run `vtysh -b` once for all-startup
authorDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 19:21:19 +0000 (20:21 +0100)
committerDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 19:21:19 +0000 (20:21 +0100)
As noted by Donald:

When FRR is starting all daemons (or restarting them all) FRR is reading
in the configuration 1 time for each daemon specified to run. This is
not a big deal if you have a very small configuration. But with large
configurations FRR is taking long enough that watchfrr is not
establishing connection to all the daemons and starting some over.

Modify the code so that vtysh is only read in at the end of a all
sequence. If we are restarting an individual daemon allow the read in of
the whole config.

Reported-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
tools/frrcommon.sh.in

index 3dbc6a1b43b9c7bd8472015b49a1de6ef760f944..2d925dbac3f77b86c426948d623931c0654866e0 100644 (file)
@@ -149,6 +149,10 @@ daemon_prep() {
 
 daemon_start() {
        local dmninst daemon inst args instopt wrap bin
+
+       all=false
+       [ "$1" = "--all" ] && { all=true; shift; }
+
        daemon_inst "$1"
 
        ulimit -n $MAX_FDS > /dev/null 2> /dev/null
@@ -165,7 +169,11 @@ daemon_start() {
 
        if eval "$all_wrap $wrap $bin $nsopt -d $frr_global_options $instopt $args"; then
                log_success_msg "Started $dmninst"
-               vtysh_b "$daemon"
+               if $all; then
+                       debug "Skipping startup of vtysh until all have started"
+               else
+                       vtysh_b "$daemon"
+               fi
        else
                log_failure_msg "Failed to start $dmninst!"
        fi
@@ -237,8 +245,9 @@ print_status() {
 all_start() {
        daemon_list daemons
        for dmninst in $daemons; do
-               daemon_start "$dmninst"
+               daemon_start --all "$dmninst"
        done
+       vtysh_b
 }
 
 all_stop() {