Skip to content

Commit e986e2b

Browse files
authored
flake.nix: Restart forever, with backoff timer (#14)
RestartSteps and RestartMaxDelaySec were introduced in systemd 254: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#RestartSteps=
1 parent eddf6d6 commit e986e2b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

flake.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,16 @@
111111
after = ["tailscaled.service"];
112112
wants = ["tailscaled.service"];
113113
wantedBy = ["multi-user.target"];
114+
# Never give up on trying to restart
115+
startLimitIntervalSec = 0;
114116
serviceConfig = {
115117
Type = "exec";
116-
Restart = "on-failure";
118+
Restart = "always";
119+
# Restart at increasing intervals to avoid things like EC2
120+
# metadata service rate limits
121+
RestartSec = 1;
122+
RestartSteps = 30;
123+
RestartMaxDelaySec = 60;
117124
ExecStart = lib.escapeShellArgs (
118125
[ "${cfg.package}/bin/tailscale-manager" configFile
119126
"--tailscale=${config.services.tailscale.package}/bin/tailscale"

0 commit comments

Comments
 (0)