module: restart max 5 times, set higher timeout

for initial start
This commit is contained in:
teutat3s 2024-09-19 14:09:54 +02:00
parent 57ed0da017
commit 32bb022df7
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -322,9 +322,14 @@ in
environment = { environment = {
PYTHON_PATH = "${penv}/${pkgs.python3.sitePackages}"; PYTHON_PATH = "${penv}/${pkgs.python3.sitePackages}";
}; };
unitConfig = {
StartLimitBurst = "5";
StartLimitIntervalSec = "30";
};
serviceConfig = defaultServiceConfig // { serviceConfig = defaultServiceConfig // {
TimeoutStartSec = "300s"; TimeoutStartSec = "600s";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "5s";
ExecStartPre = assert cfg.adminPasswordFile != null && cfg.database.rootPasswordFile != null; pkgs.writeScript "erpnext-web-init" '' ExecStartPre = assert cfg.adminPasswordFile != null && cfg.database.rootPasswordFile != null; pkgs.writeScript "erpnext-web-init" ''
#!/bin/sh #!/bin/sh
if ! test -e ${escapeShellArg "${cfg.workDir}/.db-created"}; then if ! test -e ${escapeShellArg "${cfg.workDir}/.db-created"}; then