From f47128824e53c5555a32c3d849018d1cfe921d7c Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Sun, 2 Aug 2020 09:04:29 -0400 Subject: [PATCH] Before finishing setup, rescan the log file and root mailbox for errors --- setup/so-setup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/so-setup b/setup/so-setup index e4af88205..68ca99824 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -631,6 +631,8 @@ fi success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}') if [[ $success != 0 ]]; then SO_ERROR=1; fi +# Check entire setup log for errors or unexpected salt states and ensure cron jobs are not reporting errors to root's mailbox +if grep -q -E "ERROR|Result: False" $setup_log || [[ -s /var/spool/mail/root ]]; then SO_ERROR=1; fi if [[ -n $SO_ERROR ]]; then echo "Errors detected during setup; skipping post-setup steps to allow for analysis of failures." >> $setup_log 2>&1