We aim to install the ADO agent in RHEL-7 as a service to perform deployments there:
We aim to perform deployments towards a RHEL-7 host via Azure DevOps Services agent, with that in mind we performed the installation of the ADO agent by executing the script provided in the ADO deployment-group
What issue are we experienced while installing and running the agent:
We are attempting to stop, start the agent so that collect the changes performed in the host so that is aware of environmental dependencies changes and whatnot, but when we use systemctl stop
we experienced the same error, shared in the bellow snipped, is like the agent isn't installed, but it is because we see it online in the ADO GUI specifically in the deployment-group, Note: for the following snipped please consider I have modify values and names that are pointing to "Org-name" the "Project-name" and so forth
Authorization not available. Check if polkit service is running
Unit vsts.agent.myorg.myproject2dMy_pool.linuxx2dvm0.service not loaded.
Contrary to the above message in the second line "not loaded" if we perform a systemctl | grep running
the ADO agent service is listed as "running", we haven't perform any extra step aside the execution of the script provided by the ADO deployment-group, are we missing an extra step after that?
Also we aren't sure why the first line points to the "polkit" service
What have we tried:
Modify the installation script to add a section that set a friendlier service-name and service-description towards the file svc.sh that from what we have identify so far is the responsible of the service-name and service-creation, but it complains that the svc.sh doesn't exist meaning that we haven't fully clear in which part of the script execution this file is created, we though that was after triggering the command ./svc.sh install
, the Modified scripts version is shared below, please consider I have modify values and names that are pointing to our work
#!/bin/bash
cd /home
echo $USER
sudo chown -R $USER:$USER /home/azagent
sudo chmod -fR 775 -R $USER /home/azagent
cd /home/azagent;$AgentName = "MyAgent01"; ./config.sh --deploymentgroup --deploymentgroupname "MyDeploymentGroup" --acceptteeeula --agent $AgentName --url https://dev.azure.com/MyOrg/ --work _work --projectname 'MyProject' --runasservice; sudo ./svc.sh install
sed -i 's/SVC_NAME=`systemd-escape --path "vsts.agent.myorg.myproject2dMy_pool.linuxx2dvm0.service"`/SVC_NAME=`systemd-escape --path "vstsagent.service"`/' svc.sh
sed -i 's/SVC_DESCRIPTION="Azure Pipelines Agent (MyOrg-MyProject-DeploymentPool.HostName.Domain.com)"/SVC_DESCRIPTION="ADO agent (${HOSTNAME})"/' svc.sh
if [ sudo -x "$(./svc.sh start)" ]; then echo "svc.sh script executed"; else ./config.sh --deploymentgroup --deploymentgroupname "MyDeploymentGroup" --acceptteeeula --agent $AgentName --url https://dev.azure.com/MyOrg/ --work _work --projectname 'MyProject' --auth PAT --token tokentokentokentokentokentokentokentoken --AlwaysExtractTask N ; ./run.sh; fi
If anyone requires me to share more data, if someone thinks further steps are missing that we should consider, please reach out in the comments it would be more than welcome