Installing agent relays as services using systemd
You can find information about the steps to install agent relays to run as systemd services. After you configure an agent relay using the systemd service, the agent relay automatically restarts when it stops abruptly.
Before you begin
- The server is running.
- The agent relay is installed in the host machine.
About this task
Procedure
- Log in to the agent relay host machine.
-
Locate the product systemd directory by using the following command:
cd <install-directory>/bin/systemd
-
Edit the unit file and specify the User and
Group values that will run the agent relay.
User: The name of the user who will run the agent relay.
Group: The name of the group associated with the user.
Your interface might look like the following example:After=network.target [Service] # These must be changed (or removed) to set the appropriate agent account. User=ec2-user Group=ec2-user # Modifications to these are not supported.
Note: When you customize the user and group values, you must update the ownership of the agent relay files to match with the updated User and Group values. -
Install the service unit file by using the following commands:
sudo cp devops-deploy-agentrelay.service /etc/systemd/system chmod 664 /etc/systemd/system/devops-deploy-agentrelay.service chown root:root /etc/systemd/system/devops-deploy-agentrelay.service systemctl daemon-reload -
Enable the service to start automatically on system startup by using the
following command:
sudo systemctl enable devops-deploy-agentrelay
-
Start the agent relay as service by using the following command:
sudo systemctl start devops-deploy-agentrelay
Results
What to do next
sudo systemctl status devops-deploy-agentrelay