# Stop On-prem Agent
An on-prem agent process is typically stopped through a
SIGTERM. To send this signal to an agent you can:
- use the shutdown script (
./bin/shutdown.sh) that comes with the on-prem agent,
- or run
kill -s TERMcommand on running agent.
Agent performs graceful shutdown by itself. This helps to terminate a running on-prem agent safely without disrupting any pending requests and avoids recipe job failures or data loss.
# How does it work?
We recommend disabling the on-prem agent first, to prevent any further actions to be routed to this OPA. This can be done through the on-prem page or Developer API. To prevent disruption to your recipes, ensure that there is an active backup on-prem agent in the group.
Initiate a graceful shutdown by executing the shutdown script.
By default OPA doesn't create PID file during startup. When you will get an error saying that pid file is not found, make sure that you start on-prem agent with the following option:
and run the shutdown script with the same parameter:
The script will send
SIGTERM to gracefully terminate the agent process.
The agent will kill itself after the configured timeout if shutdown hasn't finished gracefully.
# Usage options
./shutdown.sh ./shutdown.sh --pid-file=/var/run/workato-agent/workato-agent.pid --pid-file-purge ./shutdown.sh --kill-signal=TERM ./shutdown.sh --help
# Optional arguments
|--pid-file||Path to the pid file, which contains on-prem agent process id.|
|--pid-file-purge||Purge PID file before exit.|
|--kill-signal||Signal to use.|
|--help||Display help list of all arguments, similar to this table.|