From 9f191abad14fb10d3ef843e98ab055894248ca2d Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Mon, 21 Sep 2015 21:17:38 +0000 Subject: [PATCH] syncthing: update systemd service config according to upstream example The example service config were taken from the syncthing repo: https://github.com/syncthing/syncthing/blob/master/etc/linux-systemd/system/syncthing@.service --- nixos/modules/services/networking/syncthing.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index d5accfef1cb5..4eb32b1cf306 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -54,12 +54,15 @@ in description = "Syncthing service"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - environment.STNORESTART = "placeholder"; # do not self-restart + environment.STNORESTART = "yes"; # do not self-restart + environment.STNOUPGRADE = "yes"; serviceConfig = { User = "${cfg.user}"; PermissionsStartOnly = true; - Restart = "always"; + Restart = "on-failure"; ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -home=${cfg.dataDir}"; + SuccessExitStatus = "2 3 4"; + RestartForceExitStatus="3 4"; }; };