fix(nixos): use fixed startup timeouts
This commit is contained in:
@@ -65,13 +65,6 @@
|
|||||||
default = [ ];
|
default = [ ];
|
||||||
description = "TCP ports opened for the game service.";
|
description = "TCP ports opened for the game service.";
|
||||||
};
|
};
|
||||||
|
|
||||||
startupTimeout = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "15min";
|
|
||||||
example = "30min";
|
|
||||||
description = "Time systemd allows SteamCMD update and server startup to complete.";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
@@ -145,7 +138,7 @@
|
|||||||
WorkingDirectory = "-${service.steamDir}";
|
WorkingDirectory = "-${service.steamDir}";
|
||||||
ExecStartPre = "+${prepareScript}";
|
ExecStartPre = "+${prepareScript}";
|
||||||
ExecStart = updateScript;
|
ExecStart = updateScript;
|
||||||
TimeoutStartSec = service.startupTimeout;
|
TimeoutStartSec = "15min";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -169,7 +162,7 @@
|
|||||||
];
|
];
|
||||||
ExecStart = startScript;
|
ExecStart = startScript;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
TimeoutStartSec = service.startupTimeout;
|
TimeoutStartSec = "15min";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -134,16 +134,6 @@ let
|
|||||||
default = { };
|
default = { };
|
||||||
description = "NixOS module imported into the guest interior.";
|
description = "NixOS module imported into the guest interior.";
|
||||||
};
|
};
|
||||||
startupTimeout = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "10min";
|
|
||||||
example = "30min";
|
|
||||||
description = ''
|
|
||||||
Time the host waits for this guest to finish booting before treating
|
|
||||||
container startup as failed.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
limits = {
|
limits = {
|
||||||
memory = lib.mkOption {
|
memory = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
@@ -233,7 +223,7 @@ let
|
|||||||
wants = [ bridgeDevice ];
|
wants = [ bridgeDevice ];
|
||||||
|
|
||||||
serviceConfig = lib.filterAttrs (_: v: v != null) {
|
serviceConfig = lib.filterAttrs (_: v: v != null) {
|
||||||
TimeoutStartSec = lib.mkForce cfg.startupTimeout;
|
TimeoutStartSec = lib.mkForce "10min";
|
||||||
MemoryMax = cfg.limits.memory;
|
MemoryMax = cfg.limits.memory;
|
||||||
CPUQuota = cfg.limits.cpu;
|
CPUQuota = cfg.limits.cpu;
|
||||||
TasksMax = cfg.limits.tasksMax;
|
TasksMax = cfg.limits.tasksMax;
|
||||||
|
|||||||
Reference in New Issue
Block a user