From 23fa6479853a4af50889c144ea561999717b8f62 Mon Sep 17 00:00:00 2001 From: Spaceman1984 <49917670+Spaceman1984@users.noreply.github.com> Date: Thu, 4 Jun 2020 04:47:59 +0200 Subject: [PATCH] kvm: sending std output to dev/null to prevent garbage output (#4123) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When scripts/vm/hypervisor/kvm/kvmvmactivity.sh is called with an incorrect file name, an error is printed which is then interpreted as output from the script. When an incorrect file name is passed the script prints out: stat: cannot stat ‘b51d7336-d964-44ee-be60-bf62783dabc’: No such file or directory =====> DEAD <====== The KVMHAVMActivityChecker.java checkingHB() process is expecting just =====> DEAD <====== but gets the unexpected error message and interprets the file as alive. --- scripts/vm/hypervisor/kvm/kvmvmactivity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vm/hypervisor/kvm/kvmvmactivity.sh b/scripts/vm/hypervisor/kvm/kvmvmactivity.sh index 88ee8f380bb..7e9b9b61de6 100755 --- a/scripts/vm/hypervisor/kvm/kvmvmactivity.sh +++ b/scripts/vm/hypervisor/kvm/kvmvmactivity.sh @@ -99,7 +99,7 @@ fi # Second check: disk activity check cd $MountPoint -latestUpdateTime=$(stat -c %Y $(echo $UUIDList | sed 's/,/ /g') | sort -nr | head -1) +latestUpdateTime=$(stat -c %Y $(echo $UUIDList | sed 's/,/ /g') 2> /dev/null | sort -nr | head -1) if [ ! -f $acFile ]; then echo "$SuspectTime:$latestUpdateTime:$MSTime" > $acFile