about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-05-06 03:09:01 +0200
committerGitHub <noreply@github.com>2022-05-06 03:09:01 +0200
commite5e30371bc637a843f1d1ce8fe678f6cff6b1e5e (patch)
treed04c704ce76a86ff9ba2b69138d8468deaf28d8c /nixos
parent6ad85fcb619e19338a02c68273dc8cd6ec82ef4f (diff)
parentc9a1647adeef403328f7b222666648bf8bfa0320 (diff)
Merge pull request #170210 from danderson/danderson/restart-tailscaled
nixos/tailscale: use systemctl restart during activation.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/tailscale.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/tailscale.nix b/nixos/modules/services/networking/tailscale.nix
index 1f64113950a79..36db8bfb1282c 100644
--- a/nixos/modules/services/networking/tailscale.nix
+++ b/nixos/modules/services/networking/tailscale.nix
@@ -47,6 +47,18 @@ in {
       ] ++ (lib.optionals (cfg.permitCertUid != null) [
         "TS_PERMIT_CERT_UID=${cfg.permitCertUid}"
       ]);
+      # Restart tailscaled with a single `systemctl restart` at the
+      # end of activation, rather than a `stop` followed by a later
+      # `start`. Activation over Tailscale can hang for tens of
+      # seconds in the stop+start setup, if the activation script has
+      # a significant delay between the stop and start phases
+      # (e.g. script blocked on another unit with a slow shutdown).
+      #
+      # Tailscale is aware of the correctness tradeoff involved, and
+      # already makes its upstream systemd unit robust against unit
+      # version mismatches on restart for compatibility with other
+      # linux distros.
+      stopIfChanged = false;
     };
   };
 }