summaryrefslogtreecommitdiff
path: root/hostnix/elmo/dyndns.nix
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2024-06-11 15:46:58 -0400
committerJoe Mou <dev@mou.fo>2024-06-11 16:34:59 -0400
commit1bee8e81f99a64ad21774d8bee9b8b1957b7e485 (patch)
tree257083a441f602d6930101ae8485fe564daa8bac /hostnix/elmo/dyndns.nix
parentc835f74a1c76855414666d11e9bf0aee976dee8d (diff)
Fix dynamic DNS retries and e-mail alert throttling
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;