Stopping the PATROL Agent for UNIX with a script

This section explains how to use command line script to stop the PATROL Agent on a UNIX host.

You can use the PATROL Agent process ID to stop the agent. Create a script that resembles the following example:

# run this script as root to avoid permission problems
# get the process ID for the PatrolAgent process
pid=`ps -ef | grep -v grep | grep PatrolAgent | awk '{print $2}'`
# kill the agent
kill $pid
# allow agent to shutdown before OS removes resources
sleep 2 

Note

The short sleep command gives the agent time to close its files and child processes before the operating system starts to remove resources as part of its normal shutdown procedure. Experiment with your sleep interval. It will vary based on hardware, processes running external to PATROL, number of applications, instances, and parameters running, and other environmental factors.

Was this page helpful? Yes No Submitting... Thank you

Comments