summaryrefslogtreecommitdiff
path: root/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'module.nix')
-rw-r--r--module.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/module.nix b/module.nix
index b227085..de2f20d 100644
--- a/module.nix
+++ b/module.nix
@@ -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;
};