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.
This commit is contained in:
Jean-Philippe Cugnet 2021-12-30 19:03:35 +01:00
parent e5189acc16
commit 40fb59cfc3
No known key found for this signature in database
GPG Key ID: DE7B66F71BE85E31

View File

@ -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
'';