7981ca2022
Registration failed with `open .runner: permission denied`. runner.file was the relative `.runner`, which resolves against the caller's working directory — the repo the admin ran sudo from, which the service account cannot write. The same applied to .runner.lock, so the single-process guard was skipped too. Two fixes rather than one, because either alone leaves a trap: runner.file is now absolute, and register runs with cwd set to the runner's home. An earlier draft did cd there; that was lost when the script was rewritten for a system service, and an absolute path is what makes it not matter next time. Also drops --labels from the register call, which gitea-runner ignores and warns about whenever the config file defines labels, and rewrites a config that exists while nothing is registered yet — such a config is provisional, not in use, and leaving a broken one in place was what required manual cleanup here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>