2024-02-18 02:26:24 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Forgejo Runner
|
|
|
|
Wants=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
|
|
|
Restart=on-failure
|
|
|
|
TimeoutStopSec=70
|
|
|
|
ExecStartPre=/bin/rm -f %t/forgejo-runner.service.pid %t/forgejo-runner.service.ctr-id
|
2024-03-24 18:34:51 +00:00
|
|
|
ExecStartPre=-/usr/bin/podman pull code.forgejo.org/forgejo/runner:3.4.1
|
2024-02-18 02:26:24 +00:00
|
|
|
ExecStart=/usr/bin/podman run \
|
|
|
|
--cidfile=%t/%n.ctr-id \
|
|
|
|
--cgroups=no-conmon \
|
|
|
|
--rm \
|
|
|
|
--sdnotify=conmon \
|
|
|
|
--user=0 \
|
|
|
|
-d \
|
|
|
|
--conmon-pidfile %t/forgejo-runner.service.pid \
|
|
|
|
--replace \
|
|
|
|
--env DOCKER_HOST=unix:///run/podman/podman.sock \
|
2024-03-25 23:28:36 +00:00
|
|
|
--env CONTAINER_HOST=unix:///run/podman/podman.sock \
|
2024-02-18 02:26:24 +00:00
|
|
|
--name forgejo-runner \
|
|
|
|
-v /run/podman/podman.sock:/run/podman/podman.sock \
|
|
|
|
-v /etc/forgejo-runner:/etc/forgejo-runner:ro \
|
|
|
|
-v /opt/shared-with-host:/opt/shared-with-host \
|
2024-03-24 18:34:51 +00:00
|
|
|
-v /var/forgejo-runner:/data code.forgejo.org/forgejo/runner:3.4.1 forgejo-runner daemon \
|
2024-02-18 02:26:24 +00:00
|
|
|
-c /etc/forgejo-runner/config.yaml
|
|
|
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/forgejo-runner.service.ctr-id -t 10
|
|
|
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/forgejo-runner.service.ctr-id
|
|
|
|
PIDFile=%t/forgejo-runner.service.pid
|
|
|
|
Type=forking
|
|
|
|
RestartSec=60
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target default.target
|