fix 353 - fix this Error when using ssh : 'launchctl on macos fails with "Could not find domain for"'#1960
Conversation
DrJosh9000
left a comment
There was a problem hiding this comment.
Thanks for the PR, this looks pretty good!
One general comment: can the PR title and description be more descriptive? (353 is a bug in another repo, and it's helpful when browsing old PRs to get a sense of "what" and "why" without having to dig into the changes.)
| <string>LoginWindow</string> | ||
| <string>Background</string> | ||
| <string>StandardIO</string> | ||
| </array> |
There was a problem hiding this comment.
I often see <string>System</string> as well (for instance Homebrew creates it). I'm not sure it's necessary though.
| <key>BUILDKITE_AGENT_CONFIG</key> | ||
| <string>/Users/your-build-user/.buildkite-agent/buildkite-agent.cfg</string> | ||
| </dict> | ||
| <key>LimitLoadToSessionType</key> |
There was a problem hiding this comment.
For consistency can there be a blank line between the previous item and this new one?
|
Thanks for the swift reply and constructive criticism. |
|
I am Sorry I only found out about the draft PR now I should have used that.
Use Cases for these hacky workarounds (case 2+3) are in my opinion staging enviroments, where you want stage a user having installed a Background Agent in NOTE: you might have to add a ten second delay to the deamon before bootstraping the users
|
I hope the edited title and first comment are suffient |
DrJosh9000
left a comment
There was a problem hiding this comment.
Thanks again for the PR! I'm happy for this to merge as-is, and I'll follow up with any tweaks.
I was unshure if you wanted me to make those changes and thought it would be better if you made them, because this way they would be exactly the way you like them. You should have had write access to the branch and therefore the PR but I guess I should have pointed this out - the more you learn :) |
Add a blank line, add System as a session type, and copy the change into the other plist.
templates: Tidyups from #1960
fix 353 see buildkite/docs#353 (comment)
edit:
The Error occurs because by default (without LimitLoadToSessionType) launchd tries to load the agent into the Aqua context but this context doesnt exist when you are only logged in using ssh.
The -S Background option tells launchd to load the agent into the Background Context. See changes in this PR for matching changes to the docs: buildkite/docs#1875 (comment)