0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

nixos/etcd: fix postStart check and make tests deterministic

This commit is contained in:
Jaka Hudoklin 2014-11-23 12:16:50 +01:00
parent d1493bc1ee
commit 4f592d4f29
2 changed files with 8 additions and 5 deletions

View file

@ -46,7 +46,7 @@ in {
initialCluster = mkOption {
description = "Etcd initial cluster configuration for bootstrapping.";
default = ["${cfg.name}=http://localhost:2380" "${cfg.name}=http://localhost:7001"];
default = ["${cfg.name}=http://localhost:7001"];
type = types.listOf types.str;
};
@ -123,7 +123,10 @@ in {
if [ "$(id -u)" = 0 ]; then chown etcd ${cfg.dataDir}; fi
'';
postStart = ''
until ${pkgs.curl}/bin/curl -s -o /dev/null '${head cfg.listenClientUrls}/version'; do
until ${pkgs.etcdctl}/bin/etcdctl set /nixos/state 'up'; do
sleep 1;
done
until ${pkgs.etcdctl}/bin/etcdctl get /nixos/state | grep up; do
sleep 1;
done
'';