You can set up agents to run as system services.
-
Change the owner of the agent installation folder to the user that runs the agent.
For example, if the user
agentuser1
runs the agent and the agent
installation folder is
/opt/devops-deploy/agent, run the following
command:
chown -R agentuser /opt/devops-deploy/agent/
You can find the user that runs the agent by looking at the USER property
on the agent.
-
Similarly, change the group of the agent installation folder to the group that is associated
with the user.
For example, if the agent is installed in the folder
/opt/devops-deploy/agent, run the following
command:
chgrp -R agentgroup /opt/devops-deploy/agent/
-
Make a copy of the file agent-install/bin/init/agent,
where agent-install is the installation folder of the agent.
If you are running multiple agents on the system, give the file a unique name, such as
deployagent-A.
-
In a text editor, edit the file:
- Set the property AGENT_USER to the name of the user that runs the
agent.
- Set the property AGENT_GROUP to the name of the group that is associated
with that user.
- Set the property SCRIPT to the location of the agent executable file. The
default location is /opt/devops-deploy/agent/bin/agent.
The file might look like the following
example:
AGENT_HOME="/opt/devops-deploy/agent"
AGENT_USER="agentuser"
AGENT_GROUP="agentgroup"
# == END INSTALL MODIFICATIONS ===================
ANT_HOME="$AGENT_HOME/opt/apache-ant-1.8.4"
GROOVY_HOME="$AGENT_HOME/opt/groovy-1.8.8"
SCRIPT="/opt/devops-deploy/agent/bin/agent"
-
Configure the agent to run when the system starts.
The steps depend on how your IBM®
AIX® system manages services.
The agent runs as a service. To verify that the agent is running as a service, run the
following command and verify that two processes from the agent are
running:ps -ef | grep installFolder
For
installFolder
, specify the installation folder of the
agent, such as /opt/devops-deploy/agent.
For information about the way that IBM AIX handles services, see Starting and Stopping Software via RC Directories.