Added error tolerance to metrics_client calls.
Also fixed the existing logger statement to use a better tag.
BUG=chromium:375912
TEST=manual -- on a failing lab machine
Change-Id: Ibb2545b8c3f0b4bb37ff3b08bb00dadac14dc537
Reviewed-on: https://chromium-review.googlesource.com/201346
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
diff --git a/init/tcsd.conf b/init/tcsd.conf
index 7bb6e7d..30c2704 100644
--- a/init/tcsd.conf
+++ b/init/tcsd.conf
@@ -55,10 +55,12 @@
tpm_command="00 c1 00 00 00 16 00 00 00 65 00 00 00 10 00 00 00 04 00 00 \
08 02"
count=$(($(tpmc raw $tpm_command | awk 'NR == 3 { print $8; }' || echo 0)))
- metrics_client -b -e Platform.TPM.DictionaryAttackCounter $count 30
+ metrics_client -b -e Platform.TPM.DictionaryAttackCounter $count 30 ||
+ logger -t "$UPSTART_JOB" "metrics_client -e: status $?"
if [ $count -ne 0 ]; then
- logger tcsd: WARNING: Non-zero dictionary attack counter found: $count
- metrics_client -b -v TPM.NonZeroDictionaryAttackCounter
+ logger -t "$UPSTART_JOB" "WARNING: Non-zero dictionary attack counter found: $count"
+ metrics_client -b -v TPM.NonZeroDictionaryAttackCounter ||
+ logger -t "$UPSTART_JOB" "metrics_client -v: status $?"
fi
fi
end script