Skip to content

Commit

Permalink
wireguard: restart on failure
Browse files Browse the repository at this point in the history
As a oneshot service, if the startup failed it would never be attempted again.
This is problematic when peer's addresses require DNS. DNS may not be reliably available at
the time wireguard starts. Converting this to a simple service with Restart
and RestartAfter directives allows the service to be reattempted, but at
the cost of losing the oneshot semantics.

Signed-off-by: Maximilian Bosch <maximilian@mbosch.me>
(cherry picked from commit 1bff53c)
  • Loading branch information
sjau authored and Ma27 committed May 25, 2019
1 parent c826890 commit ced7cfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nixos/modules/services/networking/wireguard.nix
Expand Up @@ -197,7 +197,9 @@ let
path = with pkgs; [ kmod iproute wireguard-tools ];

serviceConfig = {
Type = "oneshot";
Type = "simple";
Restart = "on-failure";
RestartSec = "5s";
RemainAfterExit = true;
};

Expand Down

0 comments on commit ced7cfc

Please sign in to comment.