From 38b2c039bd36e6769fb8ce9878ef9ddccdb80675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 11 Aug 2023 13:43:30 +0200 Subject: [PATCH] gitea-actions-runner: restart on failure --- .../services/continuous-integration/gitea-actions-runner.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix index 9752ba8b2a3e..d8d25898e294 100644 --- a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix +++ b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix @@ -211,6 +211,11 @@ in User = "gitea-runner"; StateDirectory = "gitea-runner"; WorkingDirectory = "-/var/lib/gitea-runner/${name}"; + + # gitea-runner might fail when gitea is restarted during upgrade. + Restart = "on-failure"; + RestartSec = 2; + ExecStartPre = [(pkgs.writeShellScript "gitea-register-runner-${name}" '' export INSTANCE_DIR="$STATE_DIRECTORY/${name}" mkdir -vp "$INSTANCE_DIR"