This is an automated email from the ASF dual-hosted git repository.

pmaheshwari pushed a commit to branch latest
in repository https://gitbox.apache.org/repos/asf/samza-hello-samza.git


The following commit(s) were added to refs/heads/latest by this push:
     new 3684762  Making script work on RHEL-7/Linux because of 
https://arfore.com/2015/10/05/rhel7-and-ncat-changes/
3684762 is described below

commit 3684762cdfccbe280e2cd715c70528115028fc9a
Author: Ray Manpreet  Singh Matharu <[email protected]>
AuthorDate: Mon Apr 15 10:11:42 2019 -0700

    Making script work on RHEL-7/Linux because of 
https://arfore.com/2015/10/05/rhel7-and-ncat-changes/
    
    Copy of https://github.com/apache/samza-hello-samza/pull/58
    applied on latest
    
    Author: Ray Manpreet  Singh Matharu <[email protected]>
    
    Reviewers: Prateek Maheshwari <[email protected]>
    
    Closes #59 from rmatharu/nc-fix-latest
---
 bin/grid | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/bin/grid b/bin/grid
index f872dc7..541c72b 100755
--- a/bin/grid
+++ b/bin/grid
@@ -189,13 +189,14 @@ wait_for_service() {
   local PORT=$2
   echo "Waiting for $SERVICE_NAME to start..."
   local CURRENT_WAIT_TIME=0
-  until $(nc -w 1 localhost $PORT); do
-    printf '.'
-    sleep 1
-    if [ $((++CURRENT_WAIT_TIME)) -eq $SERVICE_WAIT_TIMEOUT_SEC ]; then
-      printf "\nError: timed out while waiting for $SERVICE_NAME to start.\n"
-      exit 1
-    fi
+
+  while [[ $(echo | nc -w1 localhost $PORT >/dev/null 2>&1 ;echo $?) -ne 0 ]]; 
do
+      printf '.'
+      sleep 1
+      if [ $((++CURRENT_WAIT_TIME)) -eq $SERVICE_WAIT_TIMEOUT_SEC ]; then
+        printf "\nError: timed out while waiting for $SERVICE_NAME to start.\n"
+        exit 1
+      fi
   done
   printf '\n'
   echo "$SERVICE_NAME has started";

Reply via email to