-
Notifications
You must be signed in to change notification settings - Fork 876
SELinux prevents ./svc.sh install executing. #2738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What may be causing the incorrect formatting is the fact that my organisation name contains a hyphen ( I have modified your script:
Which gives:
The file
Which looks correct to me. |
I've narrowed the error
Listing the "vsts" service, it is reported as "bad":
I then analyse the file:
Googling around suggests these are just warnings, but I'm a bit stumped at this point. I wonder if the agent needs to be installed in a directory other than |
I have solved it. It's SELinux causing the problem, which you do not mention in your documentation. I have created a policy to allow SELinux to run, even surviving a reboot, however, I don't know if it will allow the service to be installed. These are the steps I took:
I'd be grateful if any Linux boffins out there care to chip in on whether I have done this correctly. I will leave this open for @microsoft to update their scripts to support "real-world" scenarios. |
I have asked the document authors to add a piece on SELinux in #7010. |
SELinux also causes access denied errors when trying to run a pipeline. I put SELinux into permissive mode and ran For Google's bots here is the error I was getting when trying to execute the pipeline:
|
Here ends my 2 day debugging odyssey. Thanks for documenting your struggle! Helped me out tremendously. Same story, hyphen in org name, SELinux marking unit file as bad. RHEL 8. "Failed to enable unit: Unit file vsts.agent.ORGNAME.AGENTPOOLNAMEAGENTNAME.service does not exist." "Failed to stop/start/enable vsts.agent.ORGNAME.AGENTPOOLNAME.AGENTNAME.service: Unit vsts.agent.ORGNAME.AGENTPOOLNAME.AGENTNAME.service not loaded." |
Corrects Issue microsoft#2738
It was noted here that users will have to edit |
* SELinux context changes for affected systems Corrects Issue #2738 * Verify sestatus is present & it is enabled. * Use bash built-in command instead of which Co-authored-by: Matt Cooper <mattc@xbox.com> Co-authored-by: Mark Roghelia <mark.roghelia@microsoft.com>
This should probably be updated for all versions of Red Hat Enterprise Linux, RHEL, not just RHEL 6. |
I had also to add the |
@ghost Is still an actual issue for you? |
@ghost Is it still an issue for you? |
@ghost I'm closing this one since there no activity on this ticket for long time. Feel free to reopen it in case issue is still actual for you. |
I know this doesn't address the full issue, but I realized that the This means you need to add an extra backslash ( Therefore,
It's ugly, but this works every time for me. Just make sure that if you have a single VM with multiple agents installed (I wouldn't recommend), then be cautious what you are grepping for using the string pattern |
Agent Version and Platform
Version of your agent?
vsts-agent-rhel.6-x64-2.163.1
OS of the machine running the agent?
Fedora Server 31
Azure DevOps Type and Version
dev.azure.com
If dev.azure.com, what is your organization name? https://dev.azure.com/public_forum
What's not working?
./svc.sh install
is not working.foo = VSTS organisation name
bar = VSTS agent pool.
I note that the script does create a file in
/etc/systemd/system
, however, the name is very odd. I susspect Linux doesn't like the'
and\
in the name:According to your documentation, it should be in the format:
Agent and Worker's Diagnostic Logs
Haven't got that far.
The text was updated successfully, but these errors were encountered: