diff options
| -rw-r--r-- | module.nix | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -72,12 +72,23 @@ in config = mkIf cfg.enable { systemd.services.ddnnss = { description = "ddnnss dynamic dns update cycle"; - after = [ "network-online.target" ]; + after = [ + "network-online.target" + "nss-lookup.target" + ]; wants = [ "network-online.target" ]; + unitConfig = { + # retry on transient failure + StartLimitIntervalSec = "10min"; + StartLimitBurst = 3; + }; + serviceConfig = { Type = "oneshot"; DynamicUser = true; + Restart = "on-failure"; + RestartSec = "30s"; LoadCredential = lib.mapAttrsToList (name: path: "${name}:${path}") cfg.credentials; ExecStart = "${getExe ddnnss} -config ${configFile}"; @@ -88,7 +99,7 @@ in wantedBy = [ "timers.target" ]; timerConfig = { # wait 2 minutes from the start, with 30 second jitter. - OnBootSec = "2min"; + OnActiveSec = "2min"; RandomizedDelaySec = "30s"; OnUnitActiveSec = cfg.interval; }; |
