]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: print daemon start cmd, vtysh_b cmd
authorQuentin Young <qlyoung@nvidia.com>
Mon, 6 Dec 2021 04:06:16 +0000 (23:06 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 16 Jun 2022 16:00:23 +0000 (12:00 -0400)
When starting a daemon, print the full command run by the init script to
start it. This gives more information and is especially helpful when
debugging wrap commands.

Also add some more logs to vtysh_b to print the command used there,
log when we exit early because frr.conf doesn't exist, and simplify the
code path for creating the command to use.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
tools/frrcommon.sh.in

index e5286d14f69258158949d2a939d15dcaffc626e1..a610e56d3b6845943c4834116450ddbff58ea180 100755 (executable)
@@ -73,12 +73,16 @@ chownfrr() {
 
 vtysh_b () {
        [ "$1" = "watchfrr" ] && return 0
-       [ -r "$C_PATH/frr.conf" ] || return 0
-       if [ -n "$1" ]; then
-               "$VTYSH" `echo $nsopt` -b -d "$1"
-       else
-               "$VTYSH" `echo $nsopt` -b
+       if [ -r "$C_PATH/frr.conf" ]; then
+               log_warning_msg "$C_PATH/frr.conf does not exist; skipping config apply"
+               return 0
        fi
+
+       cmd="$VTYSH `echo $nsopt` -b"
+       [ -n "$1" ] && cmd+=" -d $1"
+
+       log_success_msg "Sending config with '$cmd'"
+       eval "$cmd"
 }
 
 daemon_inst() {
@@ -176,7 +180,9 @@ daemon_start() {
        instopt="${inst:+-n $inst}"
        eval args="\$${daemon}_options"
 
-       if eval "$all_wrap $wrap $bin $nsopt -d $frr_global_options $instopt $args"; then
+       cmd="$all_wrap $wrap $bin $nsopt -d $frr_global_options $instopt $args"
+       log_success_msg "Starting $daemon with command: '$cmd'"
+       if eval "$cmd"; then
                log_success_msg "Started $dmninst"
                if $all; then
                        debug "Skipping startup of vtysh until all have started"