From 2959dc95644a4372dadd425fd72929d32e093177 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:18:08 -0500 Subject: [PATCH] keep logs for all 3 attempts --- salt/elasticfleet/tools/sbin/so-elastic-agent-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/elasticfleet/tools/sbin/so-elastic-agent-install b/salt/elasticfleet/tools/sbin/so-elastic-agent-install index 93889c002..8f57d217c 100644 --- a/salt/elasticfleet/tools/sbin/so-elastic-agent-install +++ b/salt/elasticfleet/tools/sbin/so-elastic-agent-install @@ -16,8 +16,6 @@ check_agent_health() { interval=10 start=$SECONDS - truncate -s 0 "$LOGFILE" - while (( SECONDS - start < timeout )); do agent_status=$(elastic-agent status 2>&1) echo -e "\n$(date)\n$agent_status\n" >> "$LOGFILE" @@ -70,6 +68,8 @@ if [[ -x /opt/so/so-elastic-agent_linux_amd64 ]]; then attempts=0 cd /opt/so/ || exit 1 + truncate -s 0 "$LOGFILE" + uninstall_agent while [[ $attempts -lt 3 ]]; do