gh runner cleanup
This commit is contained in:
@@ -34,19 +34,9 @@ mkIf builderCfg.githubRunner.enable {
|
|||||||
TimeoutStopSec = 60;
|
TimeoutStopSec = 60;
|
||||||
# Restart on failure, but not immediately
|
# Restart on failure, but not immediately
|
||||||
RestartSec = 10;
|
RestartSec = 10;
|
||||||
};
|
|
||||||
# Override the ExecStartPre to not fail if cleanup has issues
|
|
||||||
# The '-' prefix means the command failure won't cause the service to fail
|
|
||||||
path = mkForce (
|
|
||||||
let
|
|
||||||
originalPath = config.systemd.services."github-runner-${builderCfg.githubRunner.name}".path;
|
|
||||||
in
|
|
||||||
originalPath
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
# Override the unconfigure script to be failure-tolerant
|
# Override the unconfigure script to be failure-tolerant
|
||||||
systemd.services."github-runner-${builderCfg.githubRunner.name}".serviceConfig.ExecStartPre = mkForce [
|
# The '-' prefix means the command failure won't cause the service to fail
|
||||||
|
ExecStartPre = mkForce [
|
||||||
(
|
(
|
||||||
let
|
let
|
||||||
unconfigureScript = pkgs.writeShellScript "github-runner-${builderCfg.githubRunner.name}-unconfigure.sh" ''
|
unconfigureScript = pkgs.writeShellScript "github-runner-${builderCfg.githubRunner.name}-unconfigure.sh" ''
|
||||||
@@ -74,6 +64,8 @@ mkIf builderCfg.githubRunner.enable {
|
|||||||
"-${unconfigureScript} ${builderCfg.githubRunner.workDir}/${builderCfg.githubRunner.name} ${builderCfg.githubRunner.workDir} /var/log/github-runner/${builderCfg.githubRunner.name}"
|
"-${unconfigureScript} ${builderCfg.githubRunner.workDir}/${builderCfg.githubRunner.name} ${builderCfg.githubRunner.workDir} /var/log/github-runner/${builderCfg.githubRunner.name}"
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Ensure the work directory exists with proper ownership
|
# Ensure the work directory exists with proper ownership
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
|||||||
Reference in New Issue
Block a user