hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r750748 - in /hadoop/core/trunk/src/contrib/chukwa: ./ bin/ src/java/org/apache/hadoop/chukwa/datacollection/collector/ tools/init.d/ tools/service/ tools/service/chukwa-agent/ tools/service/chukwa-collector/ tools/service/chukwa-df/ tools/...
Date Fri, 06 Mar 2009 02:04:03 GMT
Author: eyang
Date: Fri Mar  6 02:04:01 2009
New Revision: 750748

URL: http://svn.apache.org/viewvc?rev=750748&view=rev
Log:
HADOOP-5360.  * Changed RPM packaging to build daemon tools scripts.
              * Changed environment variable from CHUKWA_HOME/var/run to CHUKWA_PID_DIR.

Added:
    hadoop/core/trunk/src/contrib/chukwa/bin/exec-data-loader.sh
    hadoop/core/trunk/src/contrib/chukwa/tools/service/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/run
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/
    hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/run
Modified:
    hadoop/core/trunk/src/contrib/chukwa/bin/agent.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/buildDailyArchive.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/buildHourlyArchive.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/dbAdmin.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/dbLoader.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/dbSetup.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/jettyCollector.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/nodeActivityDataLoader.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/processSinkFiles.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/systemDataLoader.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/torqueDataLoader.sh
    hadoop/core/trunk/src/contrib/chukwa/bin/watchdog.sh
    hadoop/core/trunk/src/contrib/chukwa/build.xml
    hadoop/core/trunk/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
    hadoop/core/trunk/src/contrib/chukwa/tools/init.d/chukwa-system-metrics

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/agent.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/agent.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/agent.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/agent.sh Fri Mar  6 02:04:01 2009
@@ -21,16 +21,22 @@
 
 . "$bin"/chukwa-config.sh
 
-echo "hadoop jar for agent is " ${HADOOP_JAR}
-trap '${JPS} | grep ChukwaAgent | grep -v grep | grep -o "[^ ].*" | cut -f 1 -d" " | xargs
kill -TERM ; exit 0' 1 2 15
-
-if [ "X$1" = "Xstop" ]; then
+function stop {
   echo -n "Shutting down agent..."
   JETTY_PID=`${JPS} | grep ChukwaAgent | grep -v grep | grep -o "[^ ].*" | cut -f 1 -d" "`
   kill -TERM ${JETTY_PID} >&/dev/null
   echo "done"
   exit 0
+}
+
+trap stop SIGHUP SIGINT SIGTERM
+echo "hadoop jar for agent is " ${HADOOP_JAR}
+
+if [ "X$1" = "Xstop" ]; then
+   stop
 fi
 
 
-${JAVA_HOME}/bin/java -Xms32M -Xmx64M -DAPP=agent -Dlog4j.configuration=chukwa-log4j.properties
-DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR}
-classpath ${CLASSPATH}:${CHUKWA_AGENT}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent $@
+${JAVA_HOME}/bin/java -Xms32M -Xmx64M -DAPP=agent -Dlog4j.configuration=chukwa-log4j.properties
-DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR}
-classpath ${CLASSPATH}:${CHUKWA_AGENT}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent $@ &
+
+wait $!

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/buildDailyArchive.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/buildDailyArchive.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/buildDailyArchive.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/buildDailyArchive.sh Fri Mar  6 02:04:01 2009
@@ -20,7 +20,7 @@
 bin=`cd "$bin"; pwd`
 . "$bin"/chukwa-config.sh
 
-echo "${pid}" > "$CHUKWA_HOME/var/run/buildDailyArchive.pid"
+echo "${pid}" > "$CHUKWA_PID_DIR/buildDailyArchive.pid"
 
 HADOOP_CONF_DIR="${HADOOP_HOME}/conf/"
 HADOOP_CMDE="${HADOOP_HOME}/bin/hadoop "

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/buildHourlyArchive.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/buildHourlyArchive.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/buildHourlyArchive.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/buildHourlyArchive.sh Fri Mar  6 02:04:01 2009
@@ -20,7 +20,7 @@
 bin=`cd "$bin"; pwd`
 . "$bin"/chukwa-config.sh
 
-echo "${pid}" > "$CHUKWA_HOME/var/run/buildDailyArchive.pid"
+echo "${pid}" > "$CHUKWA_PID_DIR/var/run/buildDailyArchive.pid"
 
 HADOOP_CONF_DIR="${HADOOP_HOME}/conf/"
 HADOOP_CMDE="${HADOOP_HOME}/bin/hadoop "

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/dbAdmin.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/dbAdmin.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/dbAdmin.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/dbAdmin.sh Fri Mar  6 02:04:01 2009
@@ -25,11 +25,13 @@
   export CHUKWA_IDENT_STRING="$USER"
 fi
 
-trap 'rm -f $CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-dbAdmin.sh.pid ${CHUKWA_HOME}/var/run/dbAdmin.pid;
exit 0' 1 2 15
+trap 'rm -f $CHUKWA_PID_DIR/chukwa-$CHUKWA_IDENT_STRING-dbAdmin.sh.pid ${CHUKWA_PID_DIR}/dbAdmin.pid;
exit 0' 1 2 15
 
-JVM_OPTS="-DAPP=dbAdmin -Dlog4j.configuration=chukwa-log4j.properties -DCHUKWA_HOME=${CHUKWA_HOME}
-DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}"
+CHUKWA_OPTS="-DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR}
-DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml"
+CLASS_OPTS="-classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}"
+JVM_OPTS="-DAPP=dbAdmin -Dlog4j.configuration=chukwa-log4j.properties ${CHUKWA_OPTS} ${CLASS_OPTS}"
 
-echo "${pid}" > "${CHUKWA_HOME}/var/run/dbAdmin.pid"
+echo "${pid}" > "${CHUKWA_PID_DIR}/dbAdmin.pid"
 while [ 1 ]
   do
     EXP_DATE=`date +%Y-%m-%d`
@@ -48,6 +50,7 @@
         ${JAVA_HOME}/bin/java -DCLUSTER=${CLUSTER} ${JVM_OPTS} org.apache.hadoop.chukwa.database.DataExpiration
${EXP_DATE} 91 &
         ${JAVA_HOME}/bin/java -DCLUSTER=${CLUSTER} ${JVM_OPTS} org.apache.hadoop.chukwa.database.DataExpiration
${EXP_DATE} 365 &
         ${JAVA_HOME}/bin/java -DCLUSTER=${CLUSTER} ${JVM_OPTS} org.apache.hadoop.chukwa.database.DataExpiration
${EXP_DATE} 3650 &
+        ${JAVA_HOME}/bin/java -DCLUSTER=${CLUSTER} -Dlog4j.configuration=${CHUKWA_CONF_DIR}/nagios-alert.properties
${CHUKWA_OPTS} ${CLASS_OPTS} org.apache.hadoop.chukwa.util.WatchDog &
     done
     end=`date +%s`
     duration=$(( $end - $start ))

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/dbLoader.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/dbLoader.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/dbLoader.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/dbLoader.sh Fri Mar  6 02:04:01 2009
@@ -21,5 +21,5 @@
 
 . "$bin"/chukwa-config.sh
 
-echo "${pid}" > "$CHUKWA_HOME/var/run/dbLoader.pid"
+echo "${pid}" > "$CHUKWA_PID_DIR/dbLoader.pid"
 ${JAVA_HOME}/bin/java -DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.extraction.database.MetricDataLoader $1

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/dbSetup.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/dbSetup.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/dbSetup.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/dbSetup.sh Fri Mar  6 02:04:01 2009
@@ -23,7 +23,7 @@
 
 EXP_DATE=`date +%Y-%m-%d`
 echo -n "SETUP Database partition..."
-echo "${pid}" > "$CHUKWA_HOME/var/run/dbSetup.pid"
+echo "${pid}" > "$CHUKWA_PID_DIR/dbSetup.pid"
 ${JAVA_HOME}/bin/java -DCLUSTER=$1 -DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.database.TableCreator ${EXP_DATE} 7 #>/dev/null 2>&1
 ${JAVA_HOME}/bin/java -DCLUSTER=$1 -DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.database.TableCreator ${EXP_DATE} 30 >/dev/null 2>&1
 ${JAVA_HOME}/bin/java -DCLUSTER=$1 -DDATACONFIG=${CHUKWA_CONF_DIR}/mdl.xml -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.database.TableCreator ${EXP_DATE} 91 >/dev/null 2>&1

Added: hadoop/core/trunk/src/contrib/chukwa/bin/exec-data-loader.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/exec-data-loader.sh?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/exec-data-loader.sh (added)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/exec-data-loader.sh Fri Mar  6 02:04:01 2009
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
+
+. "$bin"/chukwa-config.sh
+
+JVM_OPTS="-Xms4M -Xmx4M"
+
+PARM=$1
+
+function clean_up {
+  echo -n "Shutting down $PARM..."
+  if [ "X$PARM" == "Xsar" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Sar-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xiostat" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Iostat-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xtop" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Top-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xdf" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Df-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xnetstat" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Netstat-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xpbsnodes" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/PbsNodes-data-loader.pid`
+  fi
+  if [ "X$PARM" == "Xtorque" ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/TorqueDataLoader.pid`
+  fi
+  echo "done"
+  exit 0
+}
+
+trap clean_up SIGHUP SIGINT SIGTERM
+
+export SAR="sar -q -r -n ALL 55"
+RELEASE=`lsb_release -r | cut -b 10-`
+if [ "X${RELEASE}" = "X4" ]; then 
+    export SAR="sar -q -r -n FULL 55"
+fi
+
+if [ "X$PARM" == "Xsar" ]; then
+    ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=Sar -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec $SAR &
+fi
+
+if [ "X$PARM" == "Xiostat" ]; then
+  ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=Iostat -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec iostat -x -k 55 2 &
+fi
+
+if [ "X$PARM" == "Xtop" ]; then
+  ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=Top -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec top -b -n 1 -c &
+fi
+
+if [ "X$PARM" == "Xdf" ]; then
+  ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=Df -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec df -l &
+fi
+
+if [ "X$PARM" == "Xnetstat" ]; then
+  ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=Netstat -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec ${CHUKWA_HOME}/bin/netstat.sh &
+fi
+
+if [ "X$PARM" == "Xpbsnodes" ]; then
+  ${JAVA_HOME}/bin/java $JVM_OPTS -DPERIOD=60 -DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR}
-DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -DRECORD_TYPE=PbsNodes -Dlog4j.configuration=system-data-loader.properties
-classpath ${CLASSPATH}:${CHUKWA_CORE}:${HADOOP_JAR}:${COMMON}:${TOOLS}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.plugin.metrics.Exec "${nodeActivityCmde}" &
+fi
+
+if [ "X$PARM" == "Xtorque" ]; then
+  ${JAVA_HOME}/bin/java -DDOMAIN=${DOMAIN} -DTORQUE_SERVER=${TORQUE_SERVER} -DTORQUE_HOME=${TORQUE_HOME}
-DCHUKWA_HOME=${CHUKWA_HOME} -DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR}
-DRECORD_TYPE=Torque -Dlog4j.configuration=system-data-loader.properties -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.inputtools.mdl.TorqueDataLoader &
+fi
+
+pid=$!
+wait $pid

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/jettyCollector.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/jettyCollector.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/jettyCollector.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/jettyCollector.sh Fri Mar  6 02:04:01 2009
@@ -21,8 +21,6 @@
 
 . "$bin"/chukwa-config.sh
 
-trap 'stop; exit 0' 1 2 15
-
 function stop {
   echo -n "Shutting down Collector..."
   ${JPS} | grep CollectorStub | grep -v grep | grep -o '[^ ].*'| cut -f 1 -d" " | xargs kill
-TERM >&/dev/null
@@ -30,8 +28,12 @@
   exit 0
 }
 
+trap stop SIGHUP SIGINT SIGTERM
+
 if [ "X$1" = "Xstop" ]; then
   stop
 fi
 
-${JAVA_HOME}/bin/java -DAPP=collector -Dlog4j.configuration=chukwa-log4j.properties -DCHUKWA_HOME=${CHUKWA_HOME}
-DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.datacollection.collector.CollectorStub $@
+${JAVA_HOME}/bin/java -DAPP=collector -Dlog4j.configuration=chukwa-log4j.properties -DCHUKWA_HOME=${CHUKWA_HOME}
-DCHUKWA_CONF_DIR=${CHUKWA_CONF_DIR} -DCHUKWA_LOG_DIR=${CHUKWA_LOG_DIR} -classpath ${CLASSPATH}:${CHUKWA_CORE}:${COMMON}:${HADOOP_JAR}:${CHUKWA_CONF_DIR}
org.apache.hadoop.chukwa.datacollection.collector.CollectorStub $@ &
+
+wait $!

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/nodeActivityDataLoader.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/nodeActivityDataLoader.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/nodeActivityDataLoader.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/nodeActivityDataLoader.sh Fri Mar  6 02:04:01
2009
@@ -22,15 +22,15 @@
 
 if [ "X$1" = "Xstop" ]; then
   echo -n "Shutting down Node Activity Data Loader..."
-  if [ -f ${CHUKWA_HOME}/var/run/PbsNodes-data-loader.pid ]; then
-    kill -TERM `cat ${CHUKWA_HOME}/var/run/PbsNodes-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/PbsNodes-data-loader.pid ]; then
+    kill -TERM `cat ${CHUKWA_PID_DIR}/PbsNodes-data-loader.pid`
   fi
   echo "done"
   exit 0
 fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/PbsNodes-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/PbsNodes-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/processSinkFiles.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/processSinkFiles.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/processSinkFiles.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/processSinkFiles.sh Fri Mar  6 02:04:01 2009
@@ -24,8 +24,8 @@
   export CHUKWA_IDENT_STRING="$USER"
 fi
 
-trap 'remove_cron;rm -f $CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-processSinkFiles.sh.pid
${CHUKWA_HOME}/var/run/ProcessSinkFiles.pid; exit 0' 1 2 15
-echo "${pid}" > "$CHUKWA_HOME/var/run/ProcessSinkFiles.pid"
+trap 'remove_cron;rm -f $CHUKWA_PID_DIR/chukwa-$CHUKWA_IDENT_STRING-processSinkFiles.sh.pid
${CHUKWA_PID_DIR}/ProcessSinkFiles.pid; exit 0' 1 2 15
+echo "${pid}" > "$CHUKWA_PID_DIR/ProcessSinkFiles.pid"
 
 
 function remove_cron {
@@ -65,7 +65,7 @@
 
 if [ "X$1" = "Xstop" ]; then
   echo -n "Shutting down processSinkFiles.sh..."
-  kill -TERM `cat ${CHUKWA_HOME}/var/run/ProcessSinkFiles.pid`
+  kill -TERM `cat ${CHUKWA_PID_DIR}/ProcessSinkFiles.pid`
   echo "done"
   exit 0
 fi

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/systemDataLoader.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/systemDataLoader.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/systemDataLoader.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/systemDataLoader.sh Fri Mar  6 02:04:01 2009
@@ -24,35 +24,124 @@
 
 trap 'shutdown' 1 2 15
 
+function status {
+  EXISTS=0
+  RESULT=0
+  pidFile="${CHUKWA_PID_DIR}/Sar-data-loader.pid"
+  if [ -f $pidFile ]; then
+    pid=`head ${pidFile}`
+    ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
+    if [ $ChildPIDRunningStatus -ge 1 ]; then
+      EXISTS=1
+    fi
+  fi
+
+  if [ ${EXISTS} -lt 1 ]; then
+    echo "sar data loader is stopped."
+    RESULT=1
+  else
+    echo "sar data loader is running."
+  fi
+
+  EXISTS=0
+  pidFile="${CHUKWA_PID_DIR}/Iostat-data-loader.pid"
+  if [ -f $pidFile ]; then
+    pid=`head ${pidFile}`
+    ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
+    if [ $ChildPIDRunningStatus -ge 1 ]; then
+      EXISTS=1
+    fi
+  fi
+
+  if [ ${EXISTS} -lt 1 ]; then
+    echo "iostat data loader is stopped."
+    RESULT=1
+  else
+    echo "iostat data loader is running."
+  fi
+
+  EXISTS=0
+  pidFile="${CHUKWA_PID_DIR}/Top-data-loader.pid"
+  if [ -f $pidFile ]; then
+    pid=`head ${pidFile}`
+    ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
+    if [ $ChildPIDRunningStatus -ge 1 ]; then
+      EXISTS=1
+    fi
+  fi
+
+  if [ ${EXISTS} -lt 1 ]; then
+    echo "top data loader is stopped."
+    RESULT=1
+  else
+    echo "top data loader is running."
+  fi
+
+  EXISTS=0
+  pidFile="${CHUKWA_PID_DIR}/Df-data-loader.pid"
+  if [ -f $pidFile ]; then
+    pid=`head ${pidFile}`
+    ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
+    if [ $ChildPIDRunningStatus -ge 1 ]; then
+      EXISTS=1
+    fi
+  fi
+
+  if [ ${EXISTS} -lt 1 ]; then
+    echo "df data loader is stopped."
+    RESULT=1
+  else
+    echo "df data loader is running."
+  fi
+
+  EXISTS=0
+  pidFile="${CHUKWA_PID_DIR}/Netstat-data-loader.pid"
+  if [ -f $pidFile ]; then
+    pid=`head ${pidFile}`
+    ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
+    if [ $ChildPIDRunningStatus -ge 1 ]; then
+      EXISTS=1
+    fi
+  fi
+
+  if [ ${EXISTS} -lt 1 ]; then
+    echo "netstat data loader is stopped."
+    RESULT=1
+  else
+    echo "netstat data loader is running."
+  fi
+
+  exit $RESULT
+}
+
 function shutdown {
   echo -n "Shutting down System Data Loader..."
-  if [ -f ${CHUKWA_HOME}/var/run/Sar-data-loader.pid ]; then
-    kill -9 `cat ${CHUKWA_HOME}/var/run/Sar-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/Sar-data-loader.pid ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Sar-data-loader.pid`
   fi
-  if [ -f ${CHUKWA_HOME}/var/run/Iostat-data-loader.pid ]; then
-    kill -9 `cat ${CHUKWA_HOME}/var/run/Iostat-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/Iostat-data-loader.pid ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Iostat-data-loader.pid`
   fi
-  if [ -f ${CHUKWA_HOME}/var/run/Top-data-loader.pid ]; then
-    kill -9 `cat ${CHUKWA_HOME}/var/run/Top-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/Top-data-loader.pid ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Top-data-loader.pid`
   fi
-  if [ -f ${CHUKWA_HOME}/var/run/Df-data-loader.pid ]; then
-    kill -9 `cat ${CHUKWA_HOME}/var/run/Df-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/Df-data-loader.pid ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Df-data-loader.pid`
   fi
-  if [ -f ${CHUKWA_HOME}/var/run/Netstat-data-loader.pid ]; then
-    kill -9 `cat ${CHUKWA_HOME}/var/run/Netstat-data-loader.pid`
+  if [ -f ${CHUKWA_PID_DIR}/Netstat-data-loader.pid ]; then
+    kill -9 `cat ${CHUKWA_PID_DIR}/Netstat-data-loader.pid`
   fi
-  rm -f $CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-systemDataLoader.sh.pid
+  rm -f $CHUKWA_PID_DIR/chukwa-$CHUKWA_IDENT_STRING-systemDataLoader.sh.pid
   echo "done"
   exit 0
 }
 
+if [ "X$1" = "Xstatus" ]; then
+  status
+fi
+
 if [ "X$1" = "Xstop" ]; then
-  echo -n "Shutting down System Data Loader..."
-  if [ -f $CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-systemDataLoader.sh.pid ]; then
-    kill -TERM `head $CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-systemDataLoader.sh.pid`
-  fi
-  echo "done"
-  exit 0
+  shutdown
 fi
 
 echo -n "Starting System Data Loader..."
@@ -69,7 +158,7 @@
 #fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/Sar-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/Sar-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
@@ -83,7 +172,7 @@
 fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/Iostat-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/Iostat-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
@@ -97,7 +186,7 @@
 fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/Top-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/Top-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
@@ -111,7 +200,7 @@
 fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/Df-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/Df-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
@@ -125,7 +214,7 @@
 fi
 
 EXISTS=0
-pidFile="${CHUKWA_HOME}/var/run/Netstat-data-loader.pid"
+pidFile="${CHUKWA_PID_DIR}/Netstat-data-loader.pid"
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep Exec | grep -v grep | wc -l`
@@ -140,8 +229,3 @@
 
 echo "done"
 
-while [ 1 ]
-do
-    # sleep until shutdown signal has been sent.
-    sleep 5
-done

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/torqueDataLoader.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/torqueDataLoader.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/torqueDataLoader.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/torqueDataLoader.sh Fri Mar  6 02:04:01 2009
@@ -24,9 +24,9 @@
 
 if [ "X$1" = "Xstop" ]; then
   echo -n "Shutting down Torque Data Loader..."
-  if [ -f ${CHUKWA_HOME}/var/run/TorqueDataLoader.pid ]; then
-    kill -TERM `cat ${CHUKWA_HOME}/var/run/TorqueDataLoader.pid`
-    rm -f ${CHUKWA_HOME}/var/run/TorqueDataLoader.pid
+  if [ -f ${CHUKWA_PID_DIR}/TorqueDataLoader.pid ]; then
+    kill -TERM `cat ${CHUKWA_PID_DIR}/TorqueDataLoader.pid`
+    rm -f ${CHUKWA_PID_DIR}/TorqueDataLoader.pid
   fi
   echo "done"
   exit 0
@@ -36,7 +36,7 @@
 
 
 # start torque data loader
-pidFile=$CHUKWA_HOME/var/run/TorqueDataLoader.pid
+pidFile=$CHUKWA_PID_DIR/TorqueDataLoader.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
   ChildPIDRunningStatus=`${JPS} | grep ${pid} | grep TorqueDataLoader | grep -v grep | wc
-l`

Modified: hadoop/core/trunk/src/contrib/chukwa/bin/watchdog.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/bin/watchdog.sh?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/bin/watchdog.sh (original)
+++ hadoop/core/trunk/src/contrib/chukwa/bin/watchdog.sh Fri Mar  6 02:04:01 2009
@@ -30,22 +30,22 @@
 fi
 
 # monitor agent
-pidFile=$CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-agent.sh.pid
-if [ -f $pidFile ]; then
-  pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`ps ax | grep ${pid} | grep agent.sh | grep -v grep | wc -l`
-  if [ $ChildPIDRunningStatus -lt 1 ]; then
-      HOSTNAME=`hostname`
-      echo "${HOSTNAME}: agent pid file exists, but process missing.  Restarting agent.sh."
-      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start agent.sh &
-  fi 
-fi
+#pidFile=$CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-agent.sh.pid
+#if [ -f $pidFile ]; then
+#  pid=`head ${pidFile}`
+#  ChildPIDRunningStatus=`ps ax | grep agent.sh | grep -v grep | grep -o "[^ ].*" | grep
${pid} | wc -l`
+#  if [ $ChildPIDRunningStatus -lt 1 ]; then
+#      HOSTNAME=`hostname`
+#      echo "${HOSTNAME}: agent pid file exists, but process missing.  Restarting agent.sh."
+#      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start agent.sh &
+#  fi 
+#fi
 
 # monitor collector
 pidFile=$CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-jettyCollector.sh.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`ps ax | grep ${pid} | grep jettyCollector.sh | grep -v grep | wc
-l`
+  ChildPIDRunningStatus=`ps ax | grep jettyCollector.sh | grep -v grep | grep -o "[^ ].*"
| grep ${pid} | wc -l`
   if [ $ChildPIDRunningStatus -lt 1 ]; then
       HOSTNAME=`hostname`
       echo "${HOSTNAME}: collector pid file exists, but process missing.  Restarting jettyCollector.sh."
@@ -57,7 +57,7 @@
 pidFile=$CHUKWA_HOME/var/run/PbsNodes-data-loader.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
+  ChildPIDRunningStatus=`${JPS} | grep Exec | grep -v grep | grep -o "[^ ].*" | grep ${pid}
| wc -l`
   if [ $ChildPIDRunningStatus -lt 1 ]; then
       HOSTNAME=`hostname`
       echo "${HOSTNAME}: PbsNodes-data-loader pid file exists, but process missing.  Restarting
nodeActivityDataLoader.sh."
@@ -66,55 +66,55 @@
 fi
 
 # monitor system data loader
-pidFile=$CHUKWA_HOME/var/run/Df-data-loader.pid
-if [ -f $pidFile ]; then
-  pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
-  if [ $ChildPIDRunningStatus -lt 1 ]; then
-      HOSTNAME=`hostname`
-      echo "${HOSTNAME}: Df-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
-      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
-  fi
-fi
-
-pidFile=$CHUKWA_HOME/var/run/Iostat-data-loader.pid
-if [ -f $pidFile ]; then
-  pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
-  if [ $ChildPIDRunningStatus -lt 1 ]; then
-      HOSTNAME=`hostname`
-      echo "${HOSTNAME}: Iostat-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
-      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
-  fi
-fi
-
-pidFile=$CHUKWA_HOME/var/run/Sar-data-loader.pid
-if [ -f $pidFile ]; then
-  pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
-  if [ $ChildPIDRunningStatus -lt 1 ]; then
-      HOSTNAME=`hostname`
-      echo "${HOSTNAME}: Sar-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
-      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
-  fi
-fi
-
-pidFile=$CHUKWA_HOME/var/run/Top-data-loader.pid
-if [ -f $pidFile ]; then
-  pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
-  if [ $ChildPIDRunningStatus -lt 1 ]; then
-      HOSTNAME=`hostname`
-      echo "${HOSTNAME}: Top-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
-      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
-  fi
-fi
+#pidFile=$CHUKWA_HOME/var/run/Df-data-loader.pid
+#if [ -f $pidFile ]; then
+#  pid=`head ${pidFile}`
+#  ChildPIDRunningStatus=`${JPS} | grep Exec | grep -v grep | grep -o "[^ ].*" | grep ${pid}
| wc -l`
+#  if [ $ChildPIDRunningStatus -lt 1 ]; then
+#      HOSTNAME=`hostname`
+#      echo "${HOSTNAME}: Df-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
+#      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
+#  fi
+#fi
+
+#pidFile=$CHUKWA_HOME/var/run/Iostat-data-loader.pid
+#if [ -f $pidFile ]; then
+#  pid=`head ${pidFile}`
+#  ChildPIDRunningStatus=`${JPS} | grep Exec | grep -v grep | grep -o "[^ ].*" | grep ${pid}
| wc -l`
+#  if [ $ChildPIDRunningStatus -lt 1 ]; then
+#      HOSTNAME=`hostname`
+#      echo "${HOSTNAME}: Iostat-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
+#      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
+#  fi
+#fi
+
+#pidFile=$CHUKWA_HOME/var/run/Sar-data-loader.pid
+#if [ -f $pidFile ]; then
+#  pid=`head ${pidFile}`
+#  ChildPIDRunningStatus=`${JPS} | grep Exec | grep -v grep | grep -o "[^ ].*" | grep ${pid}
| wc -l`
+#  if [ $ChildPIDRunningStatus -lt 1 ]; then
+#      HOSTNAME=`hostname`
+#      echo "${HOSTNAME}: Sar-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
+#      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
+#  fi
+#fi
+
+#pidFile=$CHUKWA_HOME/var/run/Top-data-loader.pid
+#if [ -f $pidFile ]; then
+#  pid=`head ${pidFile}`
+#  ChildPIDRunningStatus=`${JPS} | grep Exec | grep -v grep | grep -o "[^ ].*" | grep ${pid}
| wc -l`
+#  if [ $ChildPIDRunningStatus -lt 1 ]; then
+#      HOSTNAME=`hostname`
+#      echo "${HOSTNAME}: Top-data-loader pid file exists, but process missing.  Restarting
systemDataLoader.sh."
+#      "$bin/chukwa-daemon.sh" --config $CHUKWA_CONF_DIR start systemDataLoader.sh &
+#  fi
+#fi
 
 # monitor torque data loader
 pidFile=$CHUKWA_HOME/var/run/TorqueDataLoader.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`${JPS} | grep ^${pid} | grep -v grep | wc -l`
+  ChildPIDRunningStatus=`${JPS} | grep TorqueDataLoader | grep -v grep | grep -o "[^ ].*"
| grep ${pid} | wc -l`
   if [ $ChildPIDRunningStatus -lt 1 ]; then
       HOSTNAME=`hostname`
       echo "${HOSTNAME}: pid file exists, but process missing.  Restarting torqueDataLoader.sh."
@@ -126,7 +126,7 @@
 pidFile=$CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-processSinkFiles.sh.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`ps ax | grep ${pid} | grep processSinkFiles.sh | grep -v grep |
wc -l`
+  ChildPIDRunningStatus=`ps ax | grep processSinkFiles.sh | grep -v grep | grep -o "[^ ].*"
| grep ${pid} | wc -l`
   if [ $ChildPIDRunningStatus -lt 1 ]; then
       HOSTNAME=`hostname`
       echo "${HOSTNAME}: pid file exists, but process missing.  Restarting processSinkFiles.sh."
@@ -138,7 +138,7 @@
 pidFile=$CHUKWA_HOME/var/run/chukwa-$CHUKWA_IDENT_STRING-dbAdmin.sh.pid
 if [ -f $pidFile ]; then
   pid=`head ${pidFile}`
-  ChildPIDRunningStatus=`ps ax | grep ${pid} | grep dbAdmin.sh | grep -v grep | wc -l`
+  ChildPIDRunningStatus=`ps ax | grep dbAdmin.sh | grep -v grep | grep -o "[^ ].*" | grep
${pid} | wc -l`
   if [ $ChildPIDRunningStatus -lt 1 ]; then
       HOSTNAME=`hostname`
       echo "${HOSTNAME}: pid file exists, but process missing.  Restarting dbAdmin.sh."

Modified: hadoop/core/trunk/src/contrib/chukwa/build.xml
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/build.xml?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/build.xml (original)
+++ hadoop/core/trunk/src/contrib/chukwa/build.xml Fri Mar  6 02:04:01 2009
@@ -793,6 +793,15 @@
 mv %{buildroot}/%{name}-%{version} %{buildroot}%{_prefix}
 cd %{buildroot}%{_prefix}
 mkdir -p %{buildroot}/etc/init.d
+mkdir -p %{buildroot}/service/chukwa-agent
+mkdir -p %{buildroot}/service/chukwa-collector
+mkdir -p %{buildroot}/service/chukwa-df
+mkdir -p %{buildroot}/service/chukwa-iostat
+mkdir -p %{buildroot}/service/chukwa-netstat
+mkdir -p %{buildroot}/service/chukwa-pbsnodes
+mkdir -p %{buildroot}/service/chukwa-sar
+mkdir -p %{buildroot}/service/chukwa-top
+mkdir -p %{buildroot}/service/chukwa-torque
 cat %{buildroot}%{_prefix}/tools/init.d/chukwa-data-processors | \
 sed 's:- chukwa -c:- %{uid} -c:' | \
 sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
@@ -801,30 +810,33 @@
 sed 's:- chukwa -c:- %{uid} -c:' | \
 sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
 sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-collector
-cat %{buildroot}%{_prefix}/tools/init.d/chukwa-agent | \
-sed 's:- chukwa -c:- %{uid} -c:' | \
-sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-agent
-cat %{buildroot}%{_prefix}/tools/init.d/chukwa-system-metrics | \
-sed 's:- chukwa -c:- %{uid} -c:' | \
-sed 's:CHUKWA_HOME=/usr/local:CHUKWA_HOME=%{_prefix}:' | \
-sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/etc/init.d/chukwa-system-metrics
+cat %{buildroot}%{_prefix}/tools/service/chukwa-agent/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-agent/run
+cat %{buildroot}%{_prefix}/tools/service/chukwa-df/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-df/run
+cat %{buildroot}%{_prefix}/tools/service/chukwa-iostat/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-iostat/run
+cat %{buildroot}%{_prefix}/tools/service/chukwa-netstat/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-netstat/run
+cat %{buildroot}%{_prefix}/tools/service/chukwa-sar/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-sar/run
+cat %{buildroot}%{_prefix}/tools/service/chukwa-top/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-top/run
+#cat %{buildroot}%{_prefix}/tools/service/chukwa-collector/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-collector/run
+#cat %{buildroot}%{_prefix}/tools/service/chukwa-pbsnodes/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-pbsnodes/run
+#cat %{buildroot}%{_prefix}/tools/service/chukwa-torque/run | sed 's:/usr/local/chukwa:%{_prefix}:'
| \
+#sed 's:CHUKWA_CONF_DIR=/usr/local/chukwa/conf:CHUKWA_CONF_DIR=%{_conf_dir}:' > %{buildroot}/service/chukwa-torque/run
+
 chmod a+x %{buildroot}/etc/init.d/chukwa-*
+chmod -R a+x %{buildroot}/service/chukwa-*
 rm -rf %{buildroot}%{_prefix}/src
 rm -rf %{buildroot}%{_prefix}/build.xml
 %post
 mkdir -p %{_prefix}
 echo "Congratulation!  You have successfully installed Chukwa."
-echo ""
-echo "To collect Data             : /etc/init.d/chukwa-system-metrics start"
-echo "To run Chukwa Agent         : /etc/init.d/chukwa-agent start"
-echo "To run Chukwa Collector     : /etc/init.d/chukwa-collector start"
-echo "To run Chukwa Data Processor: /etc/init.d/chukwa-data-processors start"
 %preun
-/etc/init.d/chukwa-data-processors stop
-/etc/init.d/chukwa-system-metrics stop
-/etc/init.d/chukwa-agent stop
-/etc/init.d/chukwa-collector stop
 echo
 %postun
 %files
@@ -834,8 +846,12 @@
 %defattr(-,root,root)
 /etc/init.d/chukwa-data-processors
 /etc/init.d/chukwa-collector
-/etc/init.d/chukwa-agent
-/etc/init.d/chukwa-system-metrics
+/service/chukwa-agent/run
+/service/chukwa-df/run
+/service/chukwa-iostat/run
+/service/chukwa-netstat/run
+/service/chukwa-sar/run
+/service/chukwa-top/run
                 </echo>
 		<rpm specFile="chukwa.spec" topDir="${build.dir}" cleanBuildDir="true" failOnError="true"/>
         </target>

Modified: hadoop/core/trunk/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/java/org/apache/hadoop/chukwa/datacollection/collector/CollectorStub.java
Fri Mar  6 02:04:01 2009
@@ -33,12 +33,15 @@
   public static Server jettyServer = null;
   public static void main(String[] args) {
 	
-	pFile=new PidFile("Collector");
-	Runtime.getRuntime().addShutdownHook(pFile); 	 	  
+    pFile=new PidFile("Collector");
+    Runtime.getRuntime().addShutdownHook(pFile); 	 	  
     try {
-      System.out.println("usage:  CollectorStub [portno] [pretend]");
-      System.out.println("note: if no portno defined, " +
-      		"defaults to value in chukwa-site.xml");
+      if(args.length>=1 && args[0].equalsIgnoreCase("-help")) {
+        System.out.println("usage:  CollectorStub [portno] [pretend]");
+        System.out.println("note: if no portno defined, " +
+     	                     "defaults to value in chukwa-site.xml");
+        System.exit(0);
+      }
  
       ChukwaConfiguration conf = new ChukwaConfiguration();
       int portNum = conf.getInt("chukwaCollector.http.port", 9999);

Modified: hadoop/core/trunk/src/contrib/chukwa/tools/init.d/chukwa-system-metrics
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/init.d/chukwa-system-metrics?rev=750748&r1=750747&r2=750748&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/init.d/chukwa-system-metrics (original)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/init.d/chukwa-system-metrics Fri Mar  6 02:04:01
2009
@@ -76,7 +76,8 @@
                 [ -f /var/lock/subsys/$prog ] && restart || :
         ;;
         status)
-                ps ax | grep $DAEMON | grep -v grep >&/dev/null
+                config
+                su - gmon -c "${CHUKWA_HOME}/bin/systemDataLoader.sh status >&/dev/null"
                 RETVAL=$?
                 if [ "x$RETVAL" == "x0" ]; then
                         echo "$DAEMON is running..."

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-agent/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/agent.sh --config $CHUKWA_CONF_DIR
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-collector/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/jettyCollector.sh --config $CHUKWA_CONF_DIR
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-df/run Fri Mar  6 02:04:01 2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR df
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-iostat/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR iostat
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-netstat/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR netstat
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-pbsnodes/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR pbsnodes
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-sar/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,4 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR sar

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-top/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR top
+

Added: hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/run
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/run?rev=750748&view=auto
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/run (added)
+++ hadoop/core/trunk/src/contrib/chukwa/tools/service/chukwa-torque/run Fri Mar  6 02:04:01
2009
@@ -0,0 +1,5 @@
+#!/bin/sh
+CHUKWA_CONF_DIR=/usr/local/chukwa/conf
+
+exec setuidgid gmon /usr/local/chukwa/bin/exec-data-loader.sh --config $CHUKWA_CONF_DIR torque
+



Mime
View raw message