1
0
Fork 0

Improve timers

This commit is contained in:
Malte Brandy 2020-06-15 15:55:16 +02:00
parent a876108897
commit 45ce879c22
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
2 changed files with 25 additions and 0 deletions

View file

@ -57,6 +57,25 @@ in {
gc.options = "--delete-older-than 5d";
};
# This is necessary because of transient timeouts in certificate renewal
# Retries certificate renewal every 10 minutes at most 3 times in an 45 minutes
systemd.services = let
hosts = builtins.attrNames config.services.nginx.virtualHosts;
makeConfig = host: {
name = "acme-${host}";
value = {
serviceConfig = {
Restart = "on-failure";
RestartSec = 600;
};
unitConfig = {
StartLimitIntervalSec = 2400;
StartLimitBurst = 3;
};
};
};
in builtins.listToAttrs (map makeConfig hosts);
services = {
prometheus.exporters = {
node = {

View file

@ -18,6 +18,12 @@ in {
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "/var/cache/gc-links";
Restart = "on-failure";
RestartSec = 1;
};
unitConfig = {
StartLimitIntervalSec=180;
StartLimitBurst=3;
};
script = ''
${pkgs.test-config}/bin/test-config