actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.82k stars 947 forks source link

Self hosted runner service does not start automatically on Linux Mint #3286

Closed Edvinas01 closed 1 month ago

Edvinas01 commented 4 months ago

Describe the bug After configuring the runner as a service on Linux Mint, it doesn't automatically start after the system restarts.

To Reproduce Steps to reproduce the behavior:

  1. Setup Linux Mint 21.3.
  2. Follow steps to install the runner as described here.
  3. Configure runner as a service as described here.
  4. Restart the system.
  5. Check journalctl logs, the runner fails with status=203/EXEC.
  6. Adjust service file to include /bin/bash in ExecStart.
  7. Run systemctl daemon-reload.
  8. Restart the system.
  9. Check journalctl logs, the runner fails with status=200/CHDIR.

Expected behavior The runner service automatically restarts with the OS without any errors.

Runner Version and Platform

What's not working?

The runner does not start automatically on system boot when following this guide.

Logs

Here are the logs from journalctl -u actions.runner.ORG.USR.service (note, I replaced organization name with ORG, system name with SYS and username with USR).

Before modifying the service file:

-- Boot 37af18b73b884970900d8058454e90ae --
May 14 16:23:03 SYS systemd[1]: Started GitHub Actions Runner (ORG.SYS).
May 14 16:23:03 SYS systemd[967]: actions.runner.ORG.SYS.service: Failed to locate executable /home/USR/Software/actions-runner/runsvc.sh: No such file or directory
May 14 16:23:03 SYS systemd[967]: actions.runner.ORG.SYS.service: Failed at step EXEC spawning /home/USR/Software/actions-runner/runsvc.sh: No such file or directory
May 14 16:23:03 SYS systemd[1]: actions.runner.ORG.SYS.service: Main process exited, code=exited, status=203/EXEC
May 14 16:23:03 SYS systemd[1]: actions.runner.ORG.SYS.service: Failed with result 'exit-code'.

After modifying the service file to include /bin/bash in ExecStart:

-- Boot 182ab4bd9f0a4c4aabcad80f4161a2ed --
May 14 17:16:45 SYS systemd[1]: Started GitHub Actions Runner (ORG.SYS).
May 14 17:16:45 SYS systemd[1]: actions.runner.ORG.SYS.service: Main process exited, code=exited, status=200/CHDIR
May 14 17:16:45 SYS systemd[1]: actions.runner.ORG.SYS.service: Failed with result 'exit-code'.

More Info

  1. If I start the service manually via sudo ./svc.sh start it works fine, only when restarting the service doesn't boot up automatically.
  2. Service file created by svc.sh (note, I added /bin/bash to ExecStart):
    
    [Unit]
    Description=GitHub Actions Runner (ORG.SYS)
    After=network.target

[Service] ExecStart=/bin/bash /home/USR/Software/actions-runner/runsvc.sh User=USR WorkingDirectory=/home/USR/Software/actions-runner KillMode=process KillSignal=SIGTERM TimeoutStopSec=5min

[Install] WantedBy=multi-user.target


3. This is a clean Linux Mint install with just the runner installed and nothing else.
qtxie commented 1 month ago

Seems need to copy the service file from /etc/systemd/system to /lib/systemd/system.

nebuk89 commented 1 month ago

Sadly mint is not one of our supported distributions today https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#supported-architectures-and-operating-systems-for-self-hosted-runners