Repository: ambari Updated Branches: refs/heads/branch-2.2 bb314bd35 -> 4c4c5bc1e
AMBARI-15063 : Metrics monitor fails on restart - Commit 2 (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4c4c5bc1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4c4c5bc1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4c4c5bc1 Branch: refs/heads/branch-2.2 Commit: 4c4c5bc1e59c9014cdbdf4b2a47c8be355249e9e Parents: bb314bd Author: Aravindan Vijayan <avija...@hortonworks.com> Authored: Wed Feb 17 15:18:17 2016 -0800 Committer: Aravindan Vijayan <avija...@hortonworks.com> Committed: Wed Feb 17 15:18:17 2016 -0800 ---------------------------------------------------------------------- .../conf/unix/ambari-metrics-monitor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4c4c5bc1/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor index aa4ae02..7464c55 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor +++ b/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..." if [ -f ${PIDFILE} ]; then 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}..." rm -f ${PIDFILE} else @@ -152,7 +152,7 @@ case "$1" in sleep 2 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 echo "ERROR: ${METRIC_MONITOR} start failed. For more details, see ${OUTFILE}:" echo "====================" @@ -173,7 +173,7 @@ case "$1" in if [ -f ${PIDFILE} ]; then PID=`cat ${PIDFILE}` 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" retcode=2 else