Installing agents as services using systemd

You can find information about the steps to install agents to run as systemd services. After you configure an agent using the systemd service, the agent automatically restarts when it stops abruptly.

You must have ensured the following:
  • The server is running.
  • The agent is installed in the host machine.
  • You must be a root user.

Installing agents by using the systemd service helps you to ensure that the agent runs automatically on the system startup and restarts the agent automatically if it stops.

  1. Log in to the agent 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.

    User: The name of the user who will run the agent.

    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 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-agent.service /etc/systemd/system
    $ sudo chmod 664 /etc/systemd/system/devops-deploy-agent.service
    $ sudo chown root:root /etc/systemd/system/devops-deploy-agent.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-agent
  6. Start the agent as service by using the following command:
    $ sudo systemctl start devops-deploy-agent
You installed the agent to run as a systemd service.
You must run the following command to verify whether the agent is running as a systemd service:
$ sudo systemctl status devops-deploy-agent