bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [1/3] bigtop git commit: BIGTOP-1824. Tachyon master and worker daemon script does not work propertly
Date Fri, 01 May 2015 23:23:57 GMT
Repository: bigtop
Updated Branches:
  refs/heads/master 0c1ed66b5 -> f69e8f3d2


BIGTOP-1824. Tachyon master and worker daemon script does not work propertly

Signed-off-by: Konstantin Boudnik <cos@wandisco.com>


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/61a3f67a
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/61a3f67a
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/61a3f67a

Branch: refs/heads/master
Commit: 61a3f67aabeea6464c9db2f6c888bfcfe20b4ae4
Parents: 0c1ed66
Author: Evans Ye <evansye@apache.org>
Authored: Sat Apr 11 08:54:04 2015 +0000
Committer: Konstantin Boudnik <cos@wandisco.com>
Committed: Fri May 1 16:13:47 2015 -0700

----------------------------------------------------------------------
 bigtop-packages/src/common/tachyon/init.d.tmpl        | 2 ++
 bigtop-packages/src/common/tachyon/install_tachyon.sh | 2 +-
 bigtop-packages/src/common/tachyon/tachyon-master.svc | 8 +++++---
 bigtop-packages/src/common/tachyon/tachyon-worker.svc | 7 +++++--
 bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec    | 2 +-
 5 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/61a3f67a/bigtop-packages/src/common/tachyon/init.d.tmpl
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/tachyon/init.d.tmpl b/bigtop-packages/src/common/tachyon/init.d.tmpl
index b8de352..24b1add 100755
--- a/bigtop-packages/src/common/tachyon/init.d.tmpl
+++ b/bigtop-packages/src/common/tachyon/init.d.tmpl
@@ -29,6 +29,7 @@
 #     EXEC_PATH="path to the upstream daemon management script"
 #     SVC_USER="user to run this service as"
 #     DAEMON_FLAGS="flags to be passed to the $EXEC_PATH"
+#     KEYWORD="keyword to determine the Tachyon daemon"
 #     WORKING_DIR="working directory to cd into before starting the daemon"
 #     CONF_DIR="path to the configuration directory"
 #     PIDFILE="file holding a PID of the running daemon"
@@ -217,6 +218,7 @@ DESC="$DESC"
 EXEC_PATH="$EXEC_PATH"
 SVC_USER="$SVC_USER"
 DAEMON_FLAGS="$DAEMON_FLAGS"
+KEYWORD="$KEYWORD"
 CONF_DIR="$CONF_DIR"
 PIDFILE="$PIDFILE"
 LOCKDIR="/var/lock/subsys"

http://git-wip-us.apache.org/repos/asf/bigtop/blob/61a3f67a/bigtop-packages/src/common/tachyon/install_tachyon.sh
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/tachyon/install_tachyon.sh b/bigtop-packages/src/common/tachyon/install_tachyon.sh
index 2bf1bcc..ef0e102 100644
--- a/bigtop-packages/src/common/tachyon/install_tachyon.sh
+++ b/bigtop-packages/src/common/tachyon/install_tachyon.sh
@@ -115,7 +115,7 @@ cp -a libexec/* $PREFIX/${LIB_DIR}/libexec
 cp -rf core/src/main/webapp $PREFIX/$VAR_DIR/lib/tachyon/core/src/main
 
 # Copy in the configuration files
-install -m 0644 conf/log4j.properties conf/slaves  $PREFIX/etc/tachyon
+install -m 0644 conf/log4j.properties conf/workers $PREFIX/etc/tachyon
 cp conf/tachyon-env.sh.template  $PREFIX/etc/tachyon/tachyon-env.sh
 
 # Copy in the /usr/bin/tachyon wrapper

http://git-wip-us.apache.org/repos/asf/bigtop/blob/61a3f67a/bigtop-packages/src/common/tachyon/tachyon-master.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/tachyon/tachyon-master.svc b/bigtop-packages/src/common/tachyon/tachyon-master.svc
index e5b8fdd..00fb14c 100644
--- a/bigtop-packages/src/common/tachyon/tachyon-master.svc
+++ b/bigtop-packages/src/common/tachyon/tachyon-master.svc
@@ -19,6 +19,7 @@ DESC="Tachyon ${TYPE}"
 EXEC_PATH="/usr/lib/tachyon/bin/tachyon-start.sh"
 WORKING_DIR="/var/lib/tachyon"
 DAEMON_FLAGS="master Mount"
+KEYWORD="tachyon.master.TachyonMaster"
 CONF_DIR="/etc/tachyon/conf"
 PIDFILE="/var/run/tachyon/${DAEMON}.pid"
 
@@ -40,10 +41,12 @@ start() {
 
     /bin/bash -c "nohup nice -n 0 \
         ${EXEC_PATH} ${DAEMON_FLAGS} \
-        > $LOG_FILE 2>&1 & "'echo $!' > "$PIDFILE"
+        > $LOG_FILE 2>&1 & "
 
     sleep 3
 
+    echo `ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD | awk '{print $1}'` >
$PIDFILE
+
     checkstatusofproc
     RETVAL=$?
     [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
@@ -58,9 +61,8 @@ generate_stop() {
 cat <<'__EOT__'
 stop() {
     log_success_msg "Stopping $DESC (${DAEMON}): "
-    killproc -p $PIDFILE java
+    /usr/lib/tachyon/bin/tachyon-stop.sh master 2>&1 > /dev/null
     RETVAL=$?
-    /usr/lib/tachyon/bin/tachyon-stop.sh 2>&1 > /dev/null
 
     [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
     return $RETVAL

http://git-wip-us.apache.org/repos/asf/bigtop/blob/61a3f67a/bigtop-packages/src/common/tachyon/tachyon-worker.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/tachyon/tachyon-worker.svc b/bigtop-packages/src/common/tachyon/tachyon-worker.svc
index 2183926..ec78943 100644
--- a/bigtop-packages/src/common/tachyon/tachyon-worker.svc
+++ b/bigtop-packages/src/common/tachyon/tachyon-worker.svc
@@ -19,6 +19,7 @@ DESC="Tachyon ${TYPE}"
 EXEC_PATH="/usr/lib/tachyon/bin/tachyon-start.sh"
 WORKING_DIR="/var/lib/tachyon"
 DAEMON_FLAGS="worker Mount"
+KEYWORD="tachyon.worker.TachyonWorker"
 CONF_DIR="/etc/tachyon/conf"
 PIDFILE="/var/run/tachyon/${DAEMON}.pid"
 
@@ -44,10 +45,12 @@ start() {
 
     /bin/bash -c "nohup nice -n 0 \
         ${EXEC_PATH} ${DAEMON_FLAGS} \
-        > $LOG_FILE 2>&1 & "'echo $!' > "$PIDFILE"
+        > $LOG_FILE 2>&1 & "
 
     sleep 3
 
+    echo `ps -A -o pid,command | grep -i "[j]ava" | grep $KEYWORD | awk '{print $1}'` >
$PIDFILE
+
     checkstatusofproc
     RETVAL=$?
     [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
@@ -62,7 +65,7 @@ generate_stop() {
 cat <<'__EOT__'
 stop() {
     log_success_msg "Stopping $DESC (${DAEMON}): "
-    killproc -p $PIDFILE java
+    /usr/lib/tachyon/bin/tachyon-stop.sh worker 2>&1 > /dev/null
     RETVAL=$?
 
     [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE

http://git-wip-us.apache.org/repos/asf/bigtop/blob/61a3f67a/bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec b/bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec
index d251df0..3b9bc8b 100644
--- a/bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec
+++ b/bigtop-packages/src/rpm/tachyon/SPECS/tachyon.spec
@@ -106,7 +106,7 @@ done
 %doc LICENSE README.md
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/log4j.properties
-%config(noreplace) %{_sysconfdir}/%{name}/slaves
+%config(noreplace) %{_sysconfdir}/%{name}/workers
 %config(noreplace) %{initd_dir}/%{name}-master
 %config(noreplace) %{initd_dir}/%{name}-worker
 %config(noreplace) %{_sysconfdir}/%{name}/tachyon-env.sh


Mime
View raw message