summaryrefslogtreecommitdiff
path: root/hostnix/elmo/dyndns.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hostnix/elmo/dyndns.nix')
-rw-r--r--hostnix/elmo/dyndns.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/hostnix/elmo/dyndns.nix b/hostnix/elmo/dyndns.nix
index 5abe98c..33ce19d 100644
--- a/hostnix/elmo/dyndns.nix
+++ b/hostnix/elmo/dyndns.nix
@@ -27,15 +27,19 @@
after = [ "network-online.target" ];
unitConfig = {
AssertPathExists = "/var/secrets/dyndns";
- # Defer errors for ~45min, throttle e-mails to ~hourly.
- StartLimitIntervalSec = "1hr";
- StartLimitBurst = "45";
+ # Retry ~3min before giving up.
+ StartLimitIntervalSec = "5min";
+ StartLimitBurst = "7";
OnFailure = "status-email@%n.service";
};
serviceConfig = {
Type = "oneshot";
Restart = "on-failure";
- RestartSec = "1min";
+ # Restart must be faster than the regular timer interval to exceed the
+ # start limit when flapping.
+ RestartSec = "30";
+ # Defer OnFailure until after retries.
+ RestartMode = "direct";
};
path = [ pkgs.dnsutils pkgs.gawk pkgs.iproute2 ];
scriptArgs = config.networking.fqdn;