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

You must have ensured the following:
  • 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

  1. Log in to the agent relay host machine.
  2. Locate the product system directory by using the following command:
    $ cd <install-directory>/bin/system
  3. 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.

  4. 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
  5. Enable the service to start automatically on system startup by using the following command:
    $ sudo systemctl enable devops-deploy-agentrelay
  6. Start the agent relay as service by using the following command:
    $ sudo systemctl start devops-deploy-agentrelay

Results

You installed the agent relay to run as a systemd service.

What to do next

You must run the following command to verify whether the agent relay is running as a systemd service:
$ sudo systemctl status devops-deploy-agentrelay