Act_runner as Windows service

Hi,

the Act Runner docs mention that you should be able to run Act Runner as a Windows service. However, when I try to run it as a service (command: C:\gitea_actions\act_runner.exe daemon --config C:\gitea_actions\config.yaml ), I only get the following error message:

Roughly translated: "The service “GiteaActionRunner” on “Local Computer” could not be run. Error 1053: The service did not respond to the start or control request in a timely fashion.

Am I doing something wrong when registering the service or is there another, preferred way to running the act_runner daemon on Windows?

1 Like

The first problem may be with Error: open .runner: The system cannot find the file specified, when service launch act_runner.exe from Service Control Manager working directory (%WinDir%\System32), and it really couldn’t get .runner file from there, which by default taken from current directory. You may reproduce that behavior when start CMD from C:\Windows\system32.

So, there are 2 ways to fix:

  1. In the config.yaml (you can generate it by act_runner.exe generate-config > .\config.yaml) change runner : file : <full path to your .runner file>
  2. Or just move .runner file to the C:\Windows\system32.

But this still doesn’t solve the main problem, that the act_runner.exe does not work correctly with Windows services.

The solution is to use NSSM.exe wrapper. Download it from official site, create new service, e.g. GiteaActionRunnerNSSM, with the same properties as in Services.

It works for me at Windows Server 2019, Gitea v1.23.1 and act_runner v0.2.11

Hi could you please share your input on the nssm screen, i cant make my runner service start

@leozelion Thank you very much. I adjusted the config.yaml accordingly. I knew Windows Services were running in C:\Windows, hence the absolute paths in the command, but I had actually forgotten about the config.

With NSSM I was now able to run act_runner as a Windows service. I will however still create an issue over at GitHub · Where software is built to hopefully get it working natively.

@VicCont My NSSM config looks something like the following. Since NSSM allows to set a Startup Directory, the absolute paths are probably not required but I wanted to be on the safe side. (I used NSSM win64 2.24-101 prerelease btw since the NSSM website says something about the “normal” 2.24 release not working from Win10 Creators Update onwards):

Service name: GiteaActionRunner

Application
Path: C:\gitea_actions\act_runner.exe
Startup Directory: C:\gitea_actions
Arguments: --config C:\gitea_actions\config.yaml daemon

Details
DisplayName: GiteaActionRunner
Description: Action runner for Gitea
Startup type: Automatic

Log on
This account: *redacted*
Password: *redacted*