Skip to content

Commit

Permalink
install agent after stop
Browse files Browse the repository at this point in the history
  • Loading branch information
nagworld9 committed Dec 4, 2024
1 parent dd2deb7 commit f97331e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests_e2e/orchestrator/scripts/install-agent
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ if [ $started == false ]; then
exit 1
fi

#
# Install the package
#
echo "========== Installing Agent =========="
echo "Installing $package as version $version..."
unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version"

python=$(get-agent-python)
# Ensure that AutoUpdate is enabled. some distros, e.g. Flatcar have a waagent.conf in different path
Expand Down Expand Up @@ -162,14 +156,21 @@ if [[ $(uname -a) == *"flatcar"* ]]; then
fi

#
# Restart the service
# Install the package
#
echo "Restarting service..."
echo "========== Installing Agent =========="

agent-service stop

# Rename the previous log to ensure the new log starts with the agent we just installed
mv /var/log/waagent.log /var/log/waagent."$(date --iso-8601=seconds)".log

echo "Cleaning up the existing agents"
rm -rf /var/lib/waagent/WALinuxAgent-*

echo "Installing $package as version $version..."
unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version"

agent-service start

#
Expand Down

0 comments on commit f97331e

Please sign in to comment.