Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub action self-host runner as service fails

I have installed GitHub self-hosted runner on my Ubuntu system. Getting below error when i try to configure it as service.

$ sudo ./svc.sh start
Failed to start actions.runner._services.Linux-Host01.service: Unit actions.runner._services.Linux-Host01.service is not loaded properly: Exec format error.
See system logs and 'systemctl status actions.runner._services.Linux-Host01.service' for details.
Failed: failed to start actions.runner._services.Linux-Host01.service
$ systemctl status actions.runner._services.Linux-Host01.service
● actions.runner._services.Linux-Host01.service - GitHub Actions Runner (_services.Linux-Host01)
   Loaded: error (Reason: Exec format error)
   Active: inactive (dead)
$ cat /etc/systemd/system/actions.runner._services.Linux-Host01.service
[Unit]
Description=GitHub Actions Runner (_services.Linux-Host01)
After=network.target

[Service]
ExecStart=/home/admin.user/actions-runner/runsvc.sh
User=admin.user
WorkingDirectory=/home/admin.user/actions-runner
KillMode=process
KillSignal=SIGTERM
TimeoutStopSec=5min

[Install]
WantedBy=multi-user.target
$ sudo journalctl -u actions.runner._services.Linux-Host01.service -f

Aug 04 08:40:47 Linux-Host01 systemd[1]: /etc/systemd/system/actions.runner._services.Linux-Host01.service:7: Invalid user/group name or numeric ID: admin.user

Additionally have provided executable permission to actions.runner._services.Linux-Host01.service but still it results same error.

What is wrong here?

like image 395
user4948798 Avatar asked Apr 26 '26 16:04

user4948798


2 Answers

This simply means you've not installed the runner

  1. sudo ./svc.sh install // install the runner
  2. sudo ./svc.sh start // then start it

Remember, this is the best way to go about it than using the ./run.sh script, as the runner will always be running in the background.

Use sudo ./svc.sh status to confirm that the runner is up and running.

like image 191
Muasya Avatar answered Apr 29 '26 09:04

Muasya


I have changed User=admin.user to User=uid in the /etc/systemd/system/actions.runner._services.Linux-Host01.service file and then executed

systemctl daemon-reload

Now action service started and it is running fine.

like image 36
user4948798 Avatar answered Apr 29 '26 09:04

user4948798



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!