From df2a9c36ba89a33fcf681fd24cbc4d84f17adaeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Fri, 24 Nov 2023 17:13:56 +0800 Subject: [PATCH] ovs-healthcheck: ignore error when log file does not exist (#3456) Signed-off-by: zhangzujian --- dist/images/ovs-healthcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/images/ovs-healthcheck.sh b/dist/images/ovs-healthcheck.sh index 7b00540b89c..a8203b51372 100755 --- a/dist/images/ovs-healthcheck.sh +++ b/dist/images/ovs-healthcheck.sh @@ -39,7 +39,7 @@ ovn-ctl status_controller file="/var/log/ovn/ovn-controller.log" if [ -e $file ] then - result=$(tail -6 $file) + result=$(tail -6 $file 2>/dev/null || true) if [[ "$result" =~ "clustered database server has stale data" ]] then echo "check write to ovn sb db, clustered database server has stale data, run sb-cluster-state-reset command to restore"