Files
runneros/mkosi.extra/usr/lib/systemd/system/gitea-runner.service
T
Job79andClaude Opus 5.5 042583be77 gitea-runner.service: set HOME, which User= used to set
Without a user, the service has no HOME, and the runner needs it for its cache directory:
registration failed with "cache.dir is unset and the user home directory could not be
determined".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V27snprgiQMRMB6RRDNjCX
2026-11-14 11:47:15 +00:00

28 lines
1.3 KiB
Desktop File

# The Gitea Actions runner. Registers itself on its first start.
[Unit]
Description=Gitea Actions runner
Wants=network-online.target gitea-runner-images.service
# gitea-runner-setup writes runner.env on first boot.
After=network-online.target podman.socket gitea-runner-images.service gitea-runner-setup.service
Requires=podman.socket
[Service]
# Runs as root: it drives root's podman, which is root access anyway. The jobs it starts never
# get the socket (see config.yaml).
WorkingDirectory=/var/lib/gitea-runner
EnvironmentFile=/var/lib/gitea-runner/runner.env
Environment=HOME=/var/lib/gitea-runner
Environment=DOCKER_HOST=unix:///run/podman/podman.sock
# The hostname is the runner's name. /etc is read-only, so it is set on every start.
ExecStartPre=/usr/bin/hostnamectl hostname --transient ${GITEA_RUNNER_NAME}
# Register once; the result is kept in .runner.
ExecStartPre=/bin/sh -c '[ -f .runner ] || exec gitea-runner register --no-interactive --config /usr/lib/gitea-runner/config.yaml --instance "$GITEA_INSTANCE_URL"'
ExecStart=/usr/bin/gitea-runner daemon --config /usr/lib/gitea-runner/config.yaml
Restart=on-failure
# A bit longer than runner.shutdown_timeout, so running jobs can finish on stop.
TimeoutStopSec=35min
RestartSec=10s
[Install]
WantedBy=multi-user.target