Uninstalling the agent systemd service

You can uninstall an agent running as a systemd service when the agent is no longer required.

You must have completed the following tasks:
  • Ensured that you have the necessary permissions to uninstall agents.
  • Stopped the active deployments or tasks that are currently running on the agent.
  • Removed the agent service from assigned environments.
  • You must be a root user.

To uninstall the agent service, you must stop the agent, disable the automatic startup setting, and remove the associated service unit file.

  1. Log in to the agent host machine.
  2. Stop the agent by using the following command:
    $ sudo systemctl stop devops-deploy-agent
  3. Disable the automatic startup setting of the agent by using the following command:
    $ sudo systemctl disable devops-deploy-agent
  4. Remove the service unit file by using the following command:
    $ sudo rm /etc/systemd/system/devops-deploy-agent.service
  5. Reload the systemd configuration to check agent status by using the following command:
    $ sudo systemctl daemon-reload
You have uninstalled an agent running as a systemd service.