chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1500352 - in /incubator/chukwa/trunk: CHANGES.txt bin/chukwa bin/chukwa-config.sh
Date Sun, 07 Jul 2013 01:52:32 GMT
Author: eyang
Date: Sun Jul  7 01:52:32 2013
New Revision: 1500352

URL: http://svn.apache.org/r1500352
Log:
CHUKWA-691. Improve pid file handling. (Eric Yang)

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/bin/chukwa
    incubator/chukwa/trunk/bin/chukwa-config.sh

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1500352&r1=1500351&r2=1500352&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Sun Jul  7 01:52:32 2013
@@ -30,6 +30,8 @@ Trunk (unreleased changes)
 
   BUGS
 
+    CHUKWA-691. Improve pid file handling. (Eric Yang)
+
     CHUKWA-565. Added support HBaseWriter support for TsProcessor. (Bill Graham via Eric
Yang)
 
     CHUKWA-677. Added pid file check before starting processes. (Sreepathi Prasanna via Eric
Yang)

Modified: incubator/chukwa/trunk/bin/chukwa
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/bin/chukwa?rev=1500352&r1=1500351&r2=1500352&view=diff
==============================================================================
--- incubator/chukwa/trunk/bin/chukwa (original)
+++ incubator/chukwa/trunk/bin/chukwa Sun Jul  7 01:52:32 2013
@@ -162,8 +162,15 @@ fi
 
 pid="${CHUKWA_PID_DIR}/$PID.pid"
 if [ "$1" = "stop" ]; then
-  if [ -e $pid ]; then 
-    kill -TERM `cat $pid`
+  if [ -e $pid ]; then
+    TARGET_PID=`cat $pid`
+    if kill -0 $TARGET_PID > /dev/null 2>&1; then
+      kill -TERM $TARGET_PID
+      sleep $CHUKWA_STOP_TIMEOUT
+      if kill -0 $TARGET_PID > /dev/null 2>&1; then
+        kill -9 $TARGET_PID
+      fi
+    fi
   else 
     echo "Cannot find PID file - $PID.pid; NO $PID to stop";
   fi
@@ -178,6 +185,7 @@ else 
     ${JAVA_HOME}/bin/java ${JAVA_OPT} -Djava.library.path=${JAVA_LIBRARY_PATH} -DCHUKWA_HOME=${CHUKWA_HOME}
-DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DCHUKWA_DATA_DIR=${CHUKWA_DATA_DIR}
-DAPP=${APP} -Dlog4j.configuration=chukwa-log4j.properties -classpath ${CHUKWA_CONF_DIR}:${CLASSPATH}:${CHUKWA_CLASSPATH}:${tools}
${CLASS} $OPTS $@
   else
     exec ${JAVA_HOME}/bin/java ${JAVA_OPT} -Djava.library.path=${JAVA_LIBRARY_PATH} -DCHUKWA_HOME=${CHUKWA_HOME}
-DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DCHUKWA_DATA_DIR=${CHUKWA_DATA_DIR}
-DAPP=${APP} -Dlog4j.configuration=chukwa-log4j.properties -classpath ${CHUKWA_CONF_DIR}:${CLASSPATH}:${CHUKWA_CLASSPATH}:${tools}
${CLASS} $OPTS $@ &
+    sleep 1
   fi
 fi
 

Modified: incubator/chukwa/trunk/bin/chukwa-config.sh
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/bin/chukwa-config.sh?rev=1500352&r1=1500351&r2=1500352&view=diff
==============================================================================
--- incubator/chukwa/trunk/bin/chukwa-config.sh (original)
+++ incubator/chukwa/trunk/bin/chukwa-config.sh Sun Jul  7 01:52:32 2013
@@ -82,3 +82,4 @@ if [ -z "$JAVA_HOME" ] ; then
   echo ERROR! You forgot to set JAVA_HOME in CHUKWA_CONF_DIR/chukwa-env.sh   
 fi
 
+CHUKWA_STOP_TIMEOUT=${CHUKWA_STOP_TIMEOUT:-3}



Mime
View raw message