Skip to content

Commit 352906b

Browse files
GiteaBotnodiscc
andauthored
doc: actions/act-runner: document running as a systemd service (#27844) (#27866)
Backport #27844 by @nodiscc This documents running `act-runner` as a systemd service under a dedicated user account. Co-authored-by: nodiscc <nodiscc@gmail.com>
1 parent 6637bbf commit 352906b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/content/usage/actions/act-runner.en-us.md

+34
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,40 @@ The runner will fetch jobs from the Gitea instance and run them automatically.
268268

269269
Since act runner is still in development, it is recommended to check the latest version and upgrade it regularly.
270270

271+
## Systemd service
272+
273+
It is also possible to run act-runner as a [systemd](https://en.wikipedia.org/wiki/Systemd) service. Create an unprivileged `act_runner` user on your system, and the following file in `/etc/systemd/system/act_runner.service`. The paths in `ExecStart` and `WorkingDirectory` may need to be adjusted depending on where you installed the `act_runner` binary, its configuration file, and the home directory of the `act_runner` user.
274+
275+
```ini
276+
[Unit]
277+
Description=Gitea Actions runner
278+
Documentation=https://gitea.com/gitea/act_runner
279+
After=docker.service
280+
281+
[Service]
282+
ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml
283+
ExecReload=/bin/kill -s HUP $MAINPID
284+
WorkingDirectory=/var/lib/act_runner
285+
TimeoutSec=0
286+
RestartSec=10
287+
Restart=always
288+
User=act_runner
289+
290+
[Install]
291+
WantedBy=multi-user.target
292+
```
293+
294+
Then:
295+
296+
```bash
297+
# load the new systemd unit file
298+
sudo systemctl daemon-reload
299+
# start the service and enable it at boot
300+
sudo systemctl enable act_runner --now
301+
```
302+
303+
If using Docker, the `act_runner` user should also be added to the `docker` group before starting the service. Keep in mind that this effectively gives `act_runner` root access to the system [[1]](https://docs.docker.com/engine/security/#docker-daemon-attack-surface).
304+
271305
## Configuration variable
272306

273307
You can create configuration variables on the user, organization and repository level.

0 commit comments

Comments
 (0)