Stopping the PATROL Agent on UNIX
You can create a script to automatically stop the agent during a normal shutdown procedure. However, you do not want to perform an absolute stop (kill -9) because it forces the agent to quit before it can properly close its open files.
- Stopping the PATROL Agent for UNIX with a script
Stopping the PATROL Agent for UNIX with a configuration utility script
Stopping the PATROL Agent for UNIX from the command prompt- Stopping the PATROL Agent as a service for UNIX
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:
# 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
Stopping the PATROL Agent for UNIX with a configuration utility script
This section explains how to use a script to call the PATROL configuration utility, pconfig, which will stop the PATROL Agent on a UNIX host.
You can use the PATROL utility, pconfig, to stop the agent. Create a shell script that resembles the following example:
cd /OPT/PATROL/PATROL3
# run the script to setup your environment. This syntax assumes sh or ksh. For csh, use "source ./.patrolrc"
. ./patrolrc.sh
# change to the binary directory
cd $<PATROL_HOME>/bin
# execute pconfig to kill the agent
./pconfig +KILL +verbose -port <portnumber> -host <hostname>
# allow agent to shutdown before OS removes resources
sleep 2
Stopping the PATROL Agent for UNIX from the command prompt
You can run one of the following commands to stop the PATROL Agent running on the Unix operating system:
- ./S50PatrolAgent stop
- /etc/init.d/PatrolAgent stop
- systemctl stop PatrolAgent
Stopping the PATROL Agent as a service for UNIX
From the /etc/systemd/system directory, run the following command:
systemctl stop PatrolAgent.service