bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evan...@apache.org
Subject [bigtop] branch master updated: BIGTOP-3170. Loop and wait for daemon to be started up for Alluxio (#473)
Date Tue, 19 Feb 2019 04:48:26 GMT
This is an automated email from the ASF dual-hosted git repository.

evansye pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 2de5cd4  BIGTOP-3170. Loop and wait for daemon to be started up for Alluxio (#473)
2de5cd4 is described below

commit 2de5cd488d6573617f7c00e9eda92f03f17d465b
Author: Evans Ye <evansye@apache.org>
AuthorDate: Tue Feb 19 12:48:22 2019 +0800

    BIGTOP-3170. Loop and wait for daemon to be started up for Alluxio (#473)
---
 bigtop-packages/src/common/alluxio/alluxio-master.svc | 7 +++++--
 bigtop-packages/src/common/alluxio/alluxio-worker.svc | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bigtop-packages/src/common/alluxio/alluxio-master.svc b/bigtop-packages/src/common/alluxio/alluxio-master.svc
index f9099c0..4889539 100644
--- a/bigtop-packages/src/common/alluxio/alluxio-master.svc
+++ b/bigtop-packages/src/common/alluxio/alluxio-master.svc
@@ -43,8 +43,11 @@ start() {
         ${EXEC_PATH} ${DAEMON_FLAGS} \
         > $LOG_FILE 2>&1 & "
 
-    sleep $SLEEP_TIME
-
+    WAIT_TIMES=0
+    until ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD || [ $WAIT_TIMES -eq 10
]; do
+        (( WAIT_TIMES++ ))
+        sleep 1
+    done
     echo `ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD | awk '{print $1}'` >
$PIDFILE
 
     checkstatusofproc
diff --git a/bigtop-packages/src/common/alluxio/alluxio-worker.svc b/bigtop-packages/src/common/alluxio/alluxio-worker.svc
index 18e1774..2e69658 100644
--- a/bigtop-packages/src/common/alluxio/alluxio-worker.svc
+++ b/bigtop-packages/src/common/alluxio/alluxio-worker.svc
@@ -47,8 +47,11 @@ start() {
         ${EXEC_PATH} ${DAEMON_FLAGS} \
         > $LOG_FILE 2>&1 & "
 
-    sleep $SLEEP_TIME
-
+    WAIT_TIMES=0
+    until ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD || [ $WAIT_TIMES -eq 10
]; do
+        (( WAIT_TIMES++ ))
+        sleep 1
+    done
     echo `ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD | awk '{print $1}'` >
$PIDFILE
 
     checkstatusofproc


Mime
View raw message