Skip to content

Commit

Permalink
flake.nix: Restart forever, with backoff timer (#14)
Browse files Browse the repository at this point in the history
RestartSteps and RestartMaxDelaySec were introduced in systemd 254:

https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#RestartSteps=
  • Loading branch information
benley authored Jan 21, 2025
1 parent eddf6d6 commit e986e2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,16 @@
after = ["tailscaled.service"];
wants = ["tailscaled.service"];
wantedBy = ["multi-user.target"];
# Never give up on trying to restart
startLimitIntervalSec = 0;
serviceConfig = {
Type = "exec";
Restart = "on-failure";
Restart = "always";
# Restart at increasing intervals to avoid things like EC2
# metadata service rate limits
RestartSec = 1;
RestartSteps = 30;
RestartMaxDelaySec = 60;
ExecStart = lib.escapeShellArgs (
[ "${cfg.package}/bin/tailscale-manager" configFile
"--tailscale=${config.services.tailscale.package}/bin/tailscale"
Expand Down

0 comments on commit e986e2b

Please sign in to comment.