Files
runneros/mkosi.extra/usr/lib/systemd/system/gitea-runner.service
T
Job79andClaude Opus 5.5 b0a49de3e6 Seal /etc: read-only root with /etc and /usr, state on /var
The root filesystem (/etc and /usr) is now one read-only erofs partition behind dm-verity,
updated A/B as a whole, so /etc can no longer drift from the image (stale CA certificates,
frozen Fedora defaults). All state lives on a new /var partition, mounted by /etc/fstab.

What used to be written to /etc at runtime:
- machine ID: from the VM's firmware UUID (systemd.machine_id=firmware); /etc/machine-id is
  empty, so no boot counts as the first.
- root password: gitea-runner-setup writes a shadow file to /var/lib/shadow, which
  etc-shadow.mount puts over /etc/shadow.
- hostname and runner.env: runner.env moves to /var/lib/gitea-runner and holds the runner's
  name; gitea-runner.service sets it as the (transient) hostname, and DHCP no longer does.

Hosts installed before this change must be reinstalled: updates can't change the partition
layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V27snrGfdvwU7pMNBiDpHv
2026-11-14 12:12:10 +01: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]
# The runner drives root's podman (podman.socket.d gives this user the socket). The jobs it starts
# never get the socket (see config.yaml).
User=gitea-runner
WorkingDirectory=/var/lib/gitea-runner
EnvironmentFile=/var/lib/gitea-runner/runner.env
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 (as root: +).
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