Installing the USAS or USPS Agent
Introduction
The agents are distributed with shell scripts which may be used to run the agents automatically. These instructions assume you have followed the instructions in Daemonize the Agent. If the agents are being started manually then adjust the instructions below appropriately.
Upgrading
If a previous version of the Agent is running, stop the current running Agent prior to completing the installation steps:
Redhat
$ /etc/init.d/usps_sif stop $ /etc/init.d/usas_sif stop
Ubuntu
systemctl stop usas-sif systemctl stop usps-sif
The SSDT recommends you install into a clean directory for each version. Installing in a clean directory ensures that obsolete files do not remain from a prior version and allow you to revert to an earlier version if necessary
When upgrading, you should copy the
agent.cfg
file from the previous version to preserve your zone definitions and SOAP service configuration.If you are not using a shared keystore you will also want to copy the
Trusted.ks
andagent.ks
files from the previous installation
Download and Unpack the kit
Create a directory for USAS or USPS and the version using the pattern
USxS-SIF-n-n-n
. It is common practice to place that directory inside a directory named/SIFAgents
. For example:/SIFAgents/USPS-SIF-2-0-2
Download the agent kit from the SSDT's download site into the new directory
Unzip the kit
For example:
$ cd /SIFAgents
$ mkdir USPS-SIF-2-0-2
$ cd USPS-SIF-2-0-2
$ wget http://download.ssdt-ohio.org/ohiosif/usps-sif-agent/usps-soap-agent-2.0.2.zip
$ unzip usps-soap-agent-2.0.2.zip
Set Permissions
After unpacking the kit, ensure the following files have permissions of Owner: rwx, Group: rx, Other: rx
USPS_daemon.sh
USPS
USAS_daemon.sh
USAS
Add execute permission for all levels
For Linux, be sure to give execute access to USAS
or USPS
without an extension, USAS.exe
and USPS.exe
are Windows binaries.
Update Service File
If this is the first installation of the SIF Agent on the current server, refer to the Daemonize the Agent section.
Redhat - Update symbolic link
The service file in /etc/systemd/system
will need to be updated for the new installation directory path. Then reenable the service.
Ubuntu - Reenable service with updated path
Starting the Agent
If upgrading, copy the agent.cfg
and Agent.ks
from the previous install directory prior to starting the new agent.
The USAS_daemon.sh
or USPS_daemon.sh
scripts accept several command line parameters that can be used. The ones of most interest are:
console
– which runs agent in the foreground, is recommended for testing, and can be stopped by pressing ctrl-cstart
– starts agent in the backgroundstop
– stops the agent running in the backgroundstatus
– displays a message indicating if the agent is running
When starting a new agent for the first time, it is recommended that you start it in console
mode to display messages directly on the console. If the agent starts without errors, then press ctrl-c,
and then restart it in the background.
The example below shows a successful startup of the USPS Agent:
Running the Agent Console GUI
The SIF agents include a graphical management agent for configuring the agent and defining zones. The Agent Console does not run automatically in the background and does not need to be running for the Agent to function.
To execute the Agent Console, do:
On Linux, this command must be executed from a VNC connection in order to access the GUI interface. Alternatively, the Agent Console may be installed on a Windows workstation and used to connect remotely to the agent.
Daemonize the Agent
If this is the first installation of the Agent or the Agent is being installed using a different directory path than the previous installation, the Agent should be daemonized referrencing the installation path for the Agent. Running the agent as a daemon is helpful, because:
It can auto recover
It can auto startup
It can run without having a user logged on
For those with Redhat Linux OS, go here.
Ubuntu Linux - Daemonize the Agent
A service file for the SIF Agent needs to be created and placed in /etc/systemd/system
USAS-SIF.service
Edit USAS_daemon.sh
/ USPS_daemon.sh
to include the following at the top. The daemon.sh files are located in the installation directory of the Agent.
Enable the daemon
Start the service
Stop the service
Show Status
This command leaves you in systemctl
. You will need to enter Q to exit.
REDHAT Linux - Daemonize the Agent
Daemonize the Agent by following these steps:
Add a symbolic link to the /etc/init.d directory. For example:
Redhat
Ensure that the owner is root. If that is not the case, use the following command to change the owner to root.
Redhat
Change the rights using the following command.
Redhat
Next, use the following command to add the USAS_daemon.sh or USPS_daemon.sh to the list of daemons.
Redhat Linux
To start the agent, use this command.
Redhat
To ask if the agent is running, use this command.
Redhat
To stop the agent, use this command.