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.
-
Log in to the agent host machine.
-
Stop the agent by using the following command:
$ sudo systemctl stop devops-deploy-agent
-
Disable the automatic startup setting of the agent by using the following
command:
$ sudo systemctl disable devops-deploy-agent
-
Remove the service unit file by using the following command:
$ sudo rm /etc/systemd/system/devops-deploy-agent.service
-
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.