Skip to content

Commit 9ce0c1c

Browse files
committed
nixos/consul: Fix timeout bugs and json formatting
1 parent b866da6 commit 9ce0c1c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎nixos/modules/services/networking/consul.nix‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ in
178178
ExecReload = "${pkgs.consul}/bin/consul reload";
179179
PermissionsStartOnly = true;
180180
User = if cfg.dropPrivileges then "consul" else null;
181-
TimeoutStartSec = "${toString (20 + (3 * cfg.joinRetries))}s";
181+
TimeoutStartSec = "0";
182182
} // (optionalAttrs (cfg.leaveOnStop) {
183183
ExecStop = "${pkgs.consul}/bin/consul leave";
184184
});
@@ -209,13 +209,14 @@ in
209209
echo "$ADDR"
210210
}
211211
echo "{" > /etc/consul-addrs.json
212+
delim=" "
212213
''
213214
+ concatStrings (flip mapAttrsToList cfg.interface (name: i:
214215
optionalString (i != null) ''
215-
echo " \"${name}_addr\": \"$(getAddr "${i}")\"," >> /etc/consul-addrs.json
216+
echo "$delim \"${name}_addr\": \"$(getAddr "${i}")\"" >> /etc/consul-addrs.json
217+
delim=","
216218
''))
217219
+ ''
218-
echo " \"\": \"\"" >> /etc/consul-addrs.json
219220
echo "}" >> /etc/consul-addrs.json
220221
'';
221222
postStart = ''

0 commit comments

Comments
 (0)