From d1241be496692df878f47ea0f77d8c544e428c0f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 11 Feb 2022 16:09:04 -0800 Subject: [PATCH] configure-rabbitmq: Use rabbitmqctl ping. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our supported distributions now all have RabbitMQ ≥ 3.7.8. Signed-off-by: Anders Kaseorg --- scripts/setup/configure-rabbitmq | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/setup/configure-rabbitmq b/scripts/setup/configure-rabbitmq index e80b4f921b..e92567eefc 100755 --- a/scripts/setup/configure-rabbitmq +++ b/scripts/setup/configure-rabbitmq @@ -18,15 +18,11 @@ RABBITMQ_USERNAME=$("$(dirname "$0")/../get-django-setting" RABBITMQ_USERNAME) RABBITMQ_PASSWORD=$("$(dirname "$0")/../get-django-setting" RABBITMQ_PASSWORD) # Wait for RabbitMQ to start up -try_ping() { - # `rabbitmqctl ping` requires 3.7.6 or newer - out="$("${sudo[@]}" rabbitmqctl eval 'net_adm:ping(node()).')" && [ "$out" = 'pong' ] -} retries=29 -while ! try_ping 2>/dev/null; do +while ! "${sudo[@]}" rabbitmqctl ping -q 2>/dev/null; do sleep 1 if ! ((retries -= 1)); then - try_ping + "${sudo[@]}" rabbitmqctl ping -q break fi done