...
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.
Ubuntu Linux - Daemonize the Agent
Anchor | ||||
---|---|---|---|---|
|
A service file for the SIF Agent needs to be created and placed in /etc/systemd/system
Code Block | ||||
---|---|---|---|---|
| ||||
[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.
Anchor | ||||
---|---|---|---|---|
|
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:
...
Add a symbolic link to the /etc/init.d directory. For example:
Code Block language bash title Redhat 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 language bash title Redhat 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 language bash title Redhat 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 language bash title Redhat service usas_sif start service usas_sif start
To ask if the agent is running, use this command.
Code Block language bash title Redhat service usas_sif status service usps_sif status
To stop the agent, use this command.
Code Block language bash service usas_sif stop service usps_sif stop
...
A service file for the SIF Agent needs to be created and placed in /etc/systemd/system
Code Block | ||||
---|---|---|---|---|
| ||||
[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 |
...
title | Enable the daemon |
---|
...
_
...
title | Start the service |
---|
...
sif
...
title | Stop the service |
---|
...
stop
...
title | Show Status |
---|
...
...