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
Ubuntusystemctl 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
$ chmod +x USPS $ chmod +x USPS_daemon.sh
For Linux, be sure to give execute access to USAS
or USPS
without an extension, USAS.exe
and USPS.exe
are Windows binaries.
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:
$ ./USPS_daemon.sh console 2011-10-19 06:51:17,338 INFO [ADK.Agent] Agent directory: /SIFAgents/usps-soap-agent-2.0.2 2011-10-19 06:51:17,386 INFO [ADK.Agent] Reading configuration 2011-10-19 06:51:18,527 INFO [ADK.Agent] Backing up configuration file: /SIFAgents/usps-soap-agent-2.0.2/agent.cfg.bak 2011-10-19 06:51:18,559 INFO [ADK.Agent] Loaded configuration file (/SIFAgents/usps-soap-agent-2.0.2/agent.cfg) 2011-10-19 06:51:18,637 INFO [ADK.Agent] Updates: SIFAgentLibrary config is at version (0.0.0.0) 2011-10-19 06:51:18,637 INFO [ADK.Agent] Updates: Updating SIFAgentLibrary config to (1.5.4.0) 2011-10-19 06:51:18,639 WARN [ADK.Agent] Updates: No updater classes loaded. 2011-10-19 06:51:18,639 INFO [ADK.Agent] Updates: USPS config is at version (0.0.0.0) 2011-10-19 06:51:18,639 INFO [ADK.Agent] Updates: Updating USPS config to (2.0.2.0) 2011-10-19 06:51:18,660 INFO [ADK.Agent] Updates: Processing USPS SIF Agent configuration updates from 0.0.0.0 to 2.0.2.0 2011-10-19 06:51:18,801 INFO [ADK.Agent] Updates: Completed update 1 of 1 for USPS SIF Agent Version: 0.0.0.0 2011-10-19 06:51:18,801 INFO [ADK.Agent] Updates: Completed 1 configuration updates for USPS SIF Agent. Current version: 2.0.2.0 $ ./USPS_daemon.sh start
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:
$ cd /SIFAgents/{agent_install} $ java -jar RunConsole.jar
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.
REDHAT Linux - 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
Daemonize the Agent by following these steps:
Add a symbolic link to the /etc/init.d directory. For example:
Redhatln -fs /SIFAgents/USAS-SIF-Agent-2.0.2/USAS_daemon.sh /etc/init.d/usas_sif ln -fs /SIFAgents/USPS-SIF-Agent-2.0.2/USPS_daemon.sh /etc/init.d/usps_sif
Ensure that the owner is root. If that is not the case, use the following command to change the owner to root.
Redhatchown root:root /etc/init.d/usas_sif chown root:root /etc/init.d/usps_sif
Change the rights using the following command.
Redhatchmod 755 /etc/init.d/usas_sif chmod 755 /etc/init.d/usps_sif
Next, use the following command to add the USAS_daemon.sh or USPS_daemon.sh to the list of daemons.
Redhat Linuxchkconfig --add usas_sif chkconfig --add usps_sif chkconfig --levels 2345 usas_sif on chkconfig --levels 2345 usps_sif on
To start the agent, use this command.
Redhatservice usas_sif start service usas_sif start
To ask if the agent is running, use this command.
Redhatservice usas_sif status service usps_sif status
To stop the agent, use this command.
service usas_sif stop service usps_sif stop
Ubuntu Linux - Daemonize
A service file for the SIF Agent needs to be created and placed in /etc/systemd/system
[Unit] Description=USAS SIF Agent After=syslog.target network.target [Service] Type=forking ExecStart=/data/SIFAgents/USAS-SIF-2-0-5/USAS_daemon.sh start ExecStop=/data/SIFAgents/USAS-SIF-2-0-5/USAS_daemon.sh stop SuccessExitStatus=143 [Install] WantedBy=multi-user.target
Edit USAS_daemon.sh
/ USPS_daemon.sh
to include the following 2 lines above where it says 'Do not modify anything beyond this point'. The daemon.sh files are located in the installation directory of the Agent.
Default-Start: 2 3 4 5 Default-Stop: 0 1 6
sudo systemctl enable usas_sif
systemctl start usas-sif
systemctl stop usas-sif
systemctl status usas-sif
This command leaves you in systemctl
. You will need to enter Q to exit.