]> git.puffer.fish Git - mirror/frr.git/commit
tools: make --quiet actually suppress output 14434/head
authorJonas Gorski <jonas.gorski@bisdn.de>
Thu, 14 Sep 2023 15:04:16 +0000 (17:04 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 18 Sep 2023 08:06:49 +0000 (08:06 +0000)
commit1867d4254c963f09335b1fa3ef6dcd7760d02dbd
tree9eb33dc11c3d6824c0c102c9e11eef9c6efeae68
parent27e7c5e9d683b09bfd8d0416d236324ac8a9848d
tools: make --quiet actually suppress output

When calling daemon_stop() with --quiet and e.g. the pidfile is empty,
it won't return early since while "$fail" is set, "$2" is "--quiet", so
the if condition isn't met and it will continue executing, resulting
in error messages in the log:

> Sep 14 14:48:33 localhost watchfrr[2085]: [YFT0P-5Q5YX] Forked background command [pid 2086]: /usr/lib/frr/watchfrr.sh restart all
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec

Fix this by moving the --quiet check into the block to log_failure_msg(),
and also add the check to all other invocations of log_*_msg() to make
--quiet properly suppress output.

Fixes: 19a99d89f088 ("tools: suppress unuseful warnings during restarting frr")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
(cherry picked from commit 312d5ee1592f8c5b616d330233d1de2643f759e2)
tools/frrcommon.sh.in