Github self-hosted runner fails to run as a service on RH Linux

2.1k views Asked by At

I installed a GitHub self-hosted runner on a RH Linux EC2 instance. It runs fine in interactive mode: ./run.sh

But when trying to run it as a service. (sudo ./svc.sh start), it fails to start.

Active: failed runsvc.sh (code=exited, status=203/EXEC)

Any ideas on how to get around this?

2

There are 2 answers

3
Mikail Cayoglu On

I am running an Oracle Linux 8 instance on the Oracle Cloud and had the same issue, exactly the same error output. Very likely you have SELinux running. This is blocking your service to start. This command helped me to solve the issue:

chcon system_u:object_r:usr_t:s0 runsvc.sh
0
Joy Dingenen On

After running the chcon command, I could run the start but it crashed instantly with a status=1/failure. So i ran the chcon command on the run.sh command and in the service file found in systemd I put run.sh instead of svc.sh start.

Now it starts without problems and i can get the status of the service.

Active: active (running) since Fri 2023-02-10 11:59:14 CET; 6s ago
Main PID: 2065992 (run.sh)