]> 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)
committerDaniel 'f0o' Preussker <f0o@devilcode.org>
Mon, 19 Apr 2021 15:31:08 +0000 (15:31 +0000)
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 9a144b2b06d4527023ff7932ac9861c4e25de8ab..3f7e784ed8ce6be00c1e192522c45b92dcfa18e1 100644 (file)
@@ -146,6 +146,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
@@ -162,7 +166,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
@@ -234,8 +242,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() {