This is an automated email from the ASF dual-hosted git repository.
pmaheshwari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza-hello-samza.git
The following commit(s) were added to refs/heads/master by this push:
new 2f4eaf1 Making script work on RHEL-7/Linux because of
https://arfore.com/2015/10/05/rhel7-and-ncat-changes/
2f4eaf1 is described below
commit 2f4eaf12d000110a013c9f4f43426fed39170580
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
(cherry picked from commit 3684762cdfccbe280e2cd715c70528115028fc9a)
Signed-off-by: Prateek Maheshwari <[email protected]>
---
bin/grid | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/bin/grid b/bin/grid
index a23fc17..8b13d7a 100755
--- a/bin/grid
+++ b/bin/grid
@@ -188,13 +188,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";