From 40fb59cfc389d1726dcbf72f4fcd2cfbefcf960c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Cugnet Date: Thu, 30 Dec 2021 19:03:35 +0100 Subject: [PATCH] nixos/elasticsearch: fix postStart to allow non-localhost listenAddress Before this fix, if the listenAddress is set to something else than 127.0.0.1, the service fails to detect that Elasticsearch has properly started and stop. --- nixos/modules/services/search/elasticsearch.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix index 6df147be0c49..98c35a7ec84b 100644 --- a/nixos/modules/services/search/elasticsearch.nix +++ b/nixos/modules/services/search/elasticsearch.nix @@ -204,7 +204,7 @@ in postStart = '' # Make sure elasticsearch is up and running before dependents # are started - while ! ${pkgs.curl}/bin/curl -sS -f http://localhost:${toString cfg.port} 2>/dev/null; do + while ! ${pkgs.curl}/bin/curl -sS -f http://${cfg.listenAddress}:${toString cfg.port} 2>/dev/null; do sleep 1 done '';