Runner won't start on Ubuntu if another user is running a runner process
On Ubuntu, the upstart script contains the line:
exec start-stop-daemon --start --exec /usr/bin/gitlab-ci-multi-runner -- "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "gitlab-runner" "--syslog"
The problem is that this doesn't pass a --user
flag to start-stop-daemon
. So if any user is running their own gitlab-ci-multi-runner
process the upstart script won't start one itself. The fix is simple enough:
-exec start-stop-daemon --start --exec /usr/bin/gitlab-ci-multi-runner -- "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "gitlab-runner" "--syslog"
+exec start-stop-daemon --start --user gitlab-runner --exec /usr/bin/gitlab-ci-multi-runner -- "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "gitlab-runner" "--syslog"
All I've done is add the --user gitlab-runner
flag so that it only considers processes belonging to that user.
I'm not quite sure how this gets baked in to the gitlab-ci-multi-runner
binary. I think it's to do with the golang-kardianos-service code included here:
Is there any chance this relatively simple fix could be included?