Azure DevOpsDevelopmentDevOps

Register Linux Azure build agent as service/daemon.



In my post I investigated how to put up custom Linux build agent for Azure DevOps.

The problem is that registration to Azure DevOps is done only per session with ./ If you logout from current session or Ctrl+Break current Job Listener – registration to Azure DevOps is also dropped. So, in production environment this scenario is of no use.

Running ./

If I start agent registration by running ./ then agent registration lifespan is per user session!

Start & kill.

If I check Azure DevOps portal at point “STARTED” my build agent is online, as shown below:

Build agent online.

But, if I cancel script execution (Ctrl+C -> STOPED point) or if I exit ssh session (exit terminal) my agent goes offline!

Build agent offline.

In general, for build agents we want to be online all the time! So, let’s investigate script.

Let’s check script.

Linux Azure build agent has bash script in installation bundle. Let’s investigate what this script does. help

It’s straightforward, script can install, start, stop, display status and uninstall linux build service.

Install and start Linux service.

That’s it, Linux Azure build agent is running as service. Now, I can disconnect from console (kill session), restart build server and it will automatically register to Azure DevOps on the next boot. Nice!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.