Skip to content

Commit

Permalink
[linux/ci] start logging agent as late as possible
Browse files Browse the repository at this point in the history
There seems to be something going wrong with the logging agent when
started by the startup script, but there is very little information in
the logs about why it fails to start. When manually connecting to a
machine and trying to start the agent, everything works fine.

Therefore, we now try to put the attempted restart as late as possible
in the script, with the hope that this will work better.
  • Loading branch information
garyverhaegen-da committed May 23, 2019
1 parent 7ee7931 commit 5d2b0e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions infra/vsts_agent_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ SHUTDOWN_AGENT
access_config {}
}

service_account {
scopes = ["logging-write"]
}

scheduling {
automatic_restart = false
on_host_maintenance = "TERMINATE"
Expand Down
5 changes: 4 additions & 1 deletion infra/vsts_agent_linux_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ apt-get install -qy \
netcat

curl -sSL https://dl.google.com/cloudagents/install-logging-agent.sh | bash
systemctl restart google-fluentd.service

## Install the VSTS agent
groupadd --gid 3000 vsts
Expand Down Expand Up @@ -142,5 +141,9 @@ web-server() {
}
web-server &

# Start the log collection agent, which for some unidentified reason does not
# start correctly through the curl command above.
systemctl restart google-fluentd.service

# Start the VSTS agent
su --login --command "cd /home/vsts/agent && exec ./run.sh" - vsts

0 comments on commit 5d2b0e2

Please sign in to comment.