Introduction
The tfc-agent is a self-hosted agent for HCP Terraform and Terraform Enterprise that executes Terraform runs. When stopping an agent running in a Docker container, it is important to perform a graceful shutdown. This ensures that any in-progress Terraform run can complete successfully before the agent terminates.
Prerequisites
- HCP Terraform or Terraform Enterprise.
- A
tfc-agentdeployed using Docker.
Procedure
To gracefully stop the tfc-agent container without interrupting an active run, send the SIGINT signal using the docker kill command. This allows the agent to finish its current task before shutting down.
Execute the following command, replacing tfc-agent with the name of your agent container.
## Replace tfc-agent with your container name $ docker kill --signal SIGINT tfc-agent
Additional Information
- For guidance on running the agent as a system service, see How to run tfc-agent binary as a Service with Systemd.