summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-09-06 21:42:24 +0200
committerMel <mel@rnrd.eu>2026-09-06 21:42:24 +0200
commitddad276bf357c7fa19850181f17cb92464c9a11f (patch)
tree56fb1f23a452578d497563a7fa3d04859f9e4b84
parent309f140d38d2358cc6056ed10596024d8c8a9d66 (diff)
downloadddnnss-main.tar.zst
ddnnss-main.zip
Service should survive transient failures, retries, and orderingHEADmain
Signed-off-by: Mel <mel@rnrd.eu>
-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;
};