GitHub/Action Runner Service

From Omnia
Revision as of 23:49, 29 June 2026 by Kenneth (talk | contribs) (→‎install service)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

root user

/etc/systemd/system/github-runner.service
[Unit]
Description=GitHub Actions Runner
After=network.target

[Service]
User=root
WorkingDirectory=/opt/actions-runner
Environment="RUNNER_ALLOW_RUNASROOT=1"
ExecStart=/opt/actions-runner/run.sh
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

gha user

/etc/systemd/system/github-runner.service
[Unit]
Description=GitHub Actions Runner
After=network.target

[Service]
User=gha
WorkingDirectory=/home/gha/actions-runner
ExecStart=/home/gha/actions-runner/run.sh
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

install service

systemctl enable github-runner
  # Created symlink /etc/systemd/system/multi-user.target.wants/github-runner.service → /etc/systemd/system/github-runner.service.
systemctl daemon-reload
systemctl stop github-runner
systemctl start github-runner
systemctl status github-runner
journalctl -u github-runner

keywords