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
Installing agent relays by using the systemd service helps you to ensure that the agent relay runs automatically on the system startup and restarts the agent relay automatically if it stops.
Procedure
- Log in to the agent relay host machine.
-
Locate the product system directory by using the following command:
$ cd <install-directory>/bin/system
-
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:
Note: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 $ sudo chmod 664 /etc/systemd/system/devops-deploy-agentrelay.service $ sudo chown root:root /etc/systemd/system/devops-deploy-agentrelay.service $ sudo 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