incubator-bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r1374434 - /incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init
Date Fri, 17 Aug 2012 20:53:44 GMT
Author: rvs
Date: Fri Aug 17 20:53:44 2012
New Revision: 1374434

URL: http://svn.apache.org/viewvc?rev=1374434&view=rev
Log:
BIGTOP-691. flume gets killed too fast when the service is asked to stop

Modified:
    incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init?rev=1374434&r1=1374433&r2=1374434&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/flume/flume-node.init Fri Aug 17 20:53:44
2012
@@ -73,6 +73,7 @@ done
 
 DEFAULT_FLUME_NODE_NAME="agent"
 FLUME_NODE_NAME=${FLUME_NODE_NAME:-${DEFAULT_FLUME_NODE_NAME}}
+FLUME_SHUTDOWN_TIMEOUT=${FLUME_SHUTDOWN_TIMEOUT:-60}
 
 start() {
   [ -x $exec ] || exit $ERROR_PROGRAM_NOT_INSTALLED
@@ -101,7 +102,10 @@ stop() {
   FLUME_PID=`cat $FLUME_PID_FILE`
   if [ -n $FLUME_PID ]; then
     kill -TERM ${FLUME_PID} &>/dev/null
-    sleep 5
+    for i in `seq 1 ${FLUME_SHUTDOWN_TIMEOUT}` ; do
+      kill -0 ${FLUME_PID} &>/dev/null || break
+      sleep 1
+    done
     kill -KILL ${FLUME_PID} &>/dev/null
   fi
   rm -f $LOCKFILE $FLUME_PID_FILE



Mime
View raw message