summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/services/search/elasticsearch.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix
index b74ef4370d76..12f163db463d 100644
--- a/nixos/modules/services/search/elasticsearch.nix
+++ b/nixos/modules/services/search/elasticsearch.nix
@@ -135,6 +135,11 @@ in {
         rm ${cfg.dataDir}/plugins || true
         ln -s ${esPlugins}/plugins ${cfg.dataDir}/plugins
       '';
+      postStart = mkBefore ''
+        until ${pkgs.curl}/bin/curl -s -o /dev/null ${cfg.host}:${toString cfg.port}; do
+          sleep 1
+        done
+      '';
     };
 
     environment.systemPackages = [ pkgs.elasticsearch ];