Bladeren bron

AMBARI-15063 : Metrics monitor fails on restart - Commit 2 (avijayan)

Aravindan Vijayan 9 jaren geleden
bovenliggende
commit
8999aee37b
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor

+ 3 - 3
ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor

@@ -131,7 +131,7 @@ case "$1" in
     echo "Checking for previously running Metric Monitor..."
     echo "Checking for previously running Metric Monitor..."
     if [ -f ${PIDFILE} ]; then
     if [ -f ${PIDFILE} ]; then
       PID=`cat ${PIDFILE}`
       PID=`cat ${PIDFILE}`
-      if [ -z "`ps ax -o pid | grep -w ${PID} | grep resource_monitoring`" ]; then
+      if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
         echo "${PIDFILE} found with no process. Removing ${PID}..."
         echo "${PIDFILE} found with no process. Removing ${PID}..."
         rm -f ${PIDFILE}
         rm -f ${PIDFILE}
       else
       else
@@ -152,7 +152,7 @@ case "$1" in
     sleep 2
     sleep 2
 
 
     echo "Verifying ${METRIC_MONITOR} process status..."
     echo "Verifying ${METRIC_MONITOR} process status..."
-    if [ -z "`ps ax -o pid | grep -w ${PID} | grep resource_monitoring`" ]; then
+    if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
       if [ -s ${OUTFILE} ]; then
       if [ -s ${OUTFILE} ]; then
         echo "ERROR: ${METRIC_MONITOR} start failed. For more details, see ${OUTFILE}:"
         echo "ERROR: ${METRIC_MONITOR} start failed. For more details, see ${OUTFILE}:"
         echo "===================="
         echo "===================="
@@ -173,7 +173,7 @@ case "$1" in
     if [ -f ${PIDFILE} ]; then
     if [ -f ${PIDFILE} ]; then
       PID=`cat ${PIDFILE}`
       PID=`cat ${PIDFILE}`
       echo "Found ${METRIC_MONITOR} PID: $PID"
       echo "Found ${METRIC_MONITOR} PID: $PID"
-      if [ -z "`ps ax -o pid | grep -w ${PID} | grep resource_monitoring`" ]; then
+      if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
         echo "${METRIC_MONITOR} not running. Stale PID File at: $PIDFILE"
         echo "${METRIC_MONITOR} not running. Stale PID File at: $PIDFILE"
         retcode=2
         retcode=2
       else
       else