1

After creating the admin user on a new build server, I create the builder user via the command-line using Ansible. gitlab-runner is installed via brew and a launch daemon plist starts the service automatically as the builder user. Unfortunately, gitlab-runner hangs when git fetching changes until I manually log-in the builder user account via Remote Desktop one time and click through the first-time setup of the user account. After the initial login, you can logout, reboot and everything just works after that.

Since I have a workaround of logging in the first-time through the GUI to complete the setup of the builder user is there a way to get the macOS Mojave to do whatever it does during the first login via the command-line?

gitlab-runner.plist

For completeness, I'm providing the /Library/LaunchDaemons/gitlab-runner.plist file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>SessionCreate</key><true/>
    <key>KeepAlive</key><true/>
    <key>RunAtLoad</key><true/>
    <key>Disabled</key><false/>
    <key>Label</key>
    <string>gitlab-runner</string>
    <key>UserName</key>
    <string>builder</string>
    <key>GroupName</key>
    <string>staff</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/opt/gitlab-runner/bin/gitlab-runner</string>
      <string>run</string>
      <string>--working-directory</string>
      <string>/Users/builder</string>
      <string>--config</string>
      <string>/Users/builder/.gitlab-runner/config.toml</string>
      <string>--service</string>
      <string>gitlab-runner</string>
      <string>--syslog</string>
    </array>
  </dict>
</plist>
  • @nohillside It is not a duplicate. This isn't a question about how to write a LaunchDaemon. This is a question about some sort of account setup that occurs during a users first login. – Cameron Lowell Palmer May 6 at 7:50
  • So basically the question is "How can I enable network access from a LaunchDaemon withouth logging into the user account at least once", right? – nohillside May 6 at 8:16
  • The gitlab-runner connects to the gitlab-runner CI server, it starts the job, but git fails to fetch. So, sort of... but a bit different – Cameron Lowell Palmer May 6 at 10:03
  • The problem your question has is that it‘s not really clear whether we are talking about a with gitlab-runner or with macOS. I doubt that a lot of people here know about the former, so it make help to describe more of the macOS side of the issue. Or even create a few scripts which demonstrate the problem without having people to understand how gitlab-runner works. – nohillside May 6 at 10:15
  • Yes, it isn't clear. So since my workaround is to login once, my question is... can I make the one-time setup happen from the command-line and avoid using Remote Desktop. – Cameron Lowell Palmer May 6 at 11:04

You must log in to answer this question.

Browse other questions tagged .