[Unit] Description=Gitea Actions Runner (ephemeral) # Wait for cloud-init's final stage so the datasource's network config has # been applied and write_files has placed the runner credentials before # act_runner tries to reach Gitea. # WantedBy=cloud-init.target rather than multi-user.target — cloud-init.target # is After=multi-user.target, so combining After=cloud-final with # WantedBy=multi-user creates an ordering cycle. After=cloud-final.service Wants=cloud-final.service # Written by cloud-init from the per-VM user-data (write_files); if it's # missing the VM was booted without runner credentials, so stay down. ConditionPathExists=/var/lib/gitea-runner/.runner [Service] Type=simple User=runner Group=runner WorkingDirectory=/var/lib/gitea-runner ExecStart=/usr/local/bin/gitea-runner daemon --config /var/lib/gitea-runner/config.yaml ExecStopPost=+/sbin/poweroff -f Restart=no TimeoutStartSec=5min # SIGTERM goes only to act_runner (the main process), not to its job's # child processes — act_runner is expected to drain the current job on # SIGTERM and exit when it's done. SIGKILL escalates to the whole cgroup # after TimeoutStopSec as a safety net; the reconcile unit drops a /run # drop-in raising this to infinity during rebuilds. TimeoutStopSec=30min KillMode=mixed # Mirror runner output to /dev/console (ttyS0 here) so the host's # `journalctl -fu gitea-actions-vm-N` shows live runner state — ttyS0 is # bridged to the host unit's stdout via qemu's -serial mon:stdio. StandardOutput=journal+console StandardError=journal+console [Install] WantedBy=cloud-init.target