# 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 TERM command 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. The default shutdown timeout is set to 30 seconds.

# How does it work?

1

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.

2

Initiate a graceful shutdown by executing the shutdown script.

./shutdown.sh

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:

./run.sh --pid-file=/var/run/workato-agent/workato-agent.pid

and run the shutdown script with the same parameter:

./shutdown.sh --pid-file=/var/run/workato-agent/workato-agent.pid
3

The script will send SIGTERM to gracefully terminate the agent process.

4

The agent will kill itself after the configured timeout if shutdown hasn't finished gracefully.

# Usage options

./shutdown.sh [args…]

# Examples

./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

Argument Description
--pid-file Path to the pid file, which contains on-prem agent process id.

Default: /var/run/workato-agent/workato-agent.pid
--pid-file-purge Purge PID file before exit.
--kill-signal Signal to use.

Default: TERM
--help Display help list of all arguments, similar to this table.


Last updated: 11/3/2023, 9:36:21 AM