summary refs log tree commit diff
path: root/nixos/modules/services/networking/consul.nix
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-02-25 15:42:43 -0800
committerWilliam A. Kennington III <william@wkennington.com>2015-02-25 15:42:43 -0800
commit9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1 (patch)
treecc842772c606cc3e7bab41ec994ec6cd0c72d8de /nixos/modules/services/networking/consul.nix
parentb866da6826e6cc85cea9e6a59d9667890022b89c (diff)
downloadnixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar.gz
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar.bz2
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar.lz
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar.xz
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.tar.zst
nixpkgs-9ce0c1cb71138d0bb9f8ea314e65f084bb5095a1.zip
nixos/consul: Fix timeout bugs and json formatting
Diffstat (limited to 'nixos/modules/services/networking/consul.nix')
-rw-r--r--nixos/modules/services/networking/consul.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/consul.nix b/nixos/modules/services/networking/consul.nix
index 3ae010e8107..5308fd99508 100644
--- a/nixos/modules/services/networking/consul.nix
+++ b/nixos/modules/services/networking/consul.nix
@@ -178,7 +178,7 @@ in
         ExecReload = "${pkgs.consul}/bin/consul reload";
         PermissionsStartOnly = true;
         User = if cfg.dropPrivileges then "consul" else null;
-        TimeoutStartSec = "${toString (20 + (3 * cfg.joinRetries))}s";
+        TimeoutStartSec = "0";
       } // (optionalAttrs (cfg.leaveOnStop) {
         ExecStop = "${pkgs.consul}/bin/consul leave";
       });
@@ -209,13 +209,14 @@ in
           echo "$ADDR"
         }
         echo "{" > /etc/consul-addrs.json
+        delim=" "
       ''
       + concatStrings (flip mapAttrsToList cfg.interface (name: i:
         optionalString (i != null) ''
-          echo "    \"${name}_addr\": \"$(getAddr "${i}")\"," >> /etc/consul-addrs.json
+          echo "$delim \"${name}_addr\": \"$(getAddr "${i}")\"" >> /etc/consul-addrs.json
+          delim=","
         ''))
       + ''
-        echo "    \"\": \"\"" >> /etc/consul-addrs.json
         echo "}" >> /etc/consul-addrs.json
       '';
       postStart = ''