...
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.
...
Note |
---|
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.
Code Block |
---|
title | Redhat - Update symbolic link |
---|
|
ln -fs /SIFAgents/USPS-SIF-Agent-2.0.2/USPS_daemon.sh /etc/init.d/usps_sif |
The service file in /etc/systemd/system
will need to be updated for the new installation directory path. Then reenable the service.
Code Block |
---|
title | Ubuntu - Reenable service with updated path |
---|
|
systemctl reenable usps-sif |
Starting the Agent
Info |
---|
If upgrading, copy the agent.cfg and Agent.ks from the previous install directory prior to starting the new agent. |
...
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
Code Block |
---|
language | bash |
---|
title | USAS-SIF.service |
---|
|
[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 at the top. The daemon.sh files are located in the installation directory of the Agent.
Code Block |
---|
#! /bin/sh
### BEGIN INIT INFO
# Provides: USAS SIF
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: USAS SIF Agent
# Description: USAS SIF Agent
### END INIT INFO |
Code Block |
---|
|
sudo systemctl enable usas_sif |
Code Block |
---|
|
systemctl start usas-sif |
Code Block |
---|
|
systemctl stop usas-sif |
Code Block |
---|
|
systemctl status usas-sif |
This command leaves you in systemctl
. You will need to enter Q to exit.
REDHAT Linux - Daemonize the AgentDaemonize the Agent by following these steps:
Add a symbolic link to the /etc/init.d directory. For example:
Code Block |
---|
|
ln -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.
Code Block |
---|
|
chown root:root /etc/init.d/usas_sif
chown root:root /etc/init.d/usps_sif
|
Change the rights using the following command.
Code Block |
---|
|
chmod 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.
Code Block |
---|
language | bash |
---|
title | Redhat Linux |
---|
|
chkconfig --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.
Code Block |
---|
|
service usas_sif start
service usas_sif start
|
To ask if the agent is running, use this command.
Code Block |
---|
|
service usas_sif status
service usps_sif status
|
To stop the agent, use this command.
Code Block |
---|
|
service usas_sif stop
service usps_sif stop
|
Ubuntu Linux - Service
A service file for the SIF Agent needs to be created and placed in /etc/systemd/system
...
language | bash |
---|
title | USAS-SIF.service |
---|
...
...
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.
Code Block |
---|
Default-Start: 2 3 4 5
Default-Stop: 0 1 6 |
Code Block |
---|
|
sudo systemctl enable usas_sif |
Code Block |
---|
|
systemctl start usas-sif |
Code Block |
---|
|
systemctl stop usas-sif |
Code Block |
---|
|
systemctl status usas-sif |
...