Procházet zdrojové kódy

AMBARI-3729. Ganglia monitor started with second or third attempt on secure cluster (Dmytro Shkvyra via dlysnichenko)

Lisnichenko Dmitro před 11 roky
rodič
revize
7fcaee967c

+ 11 - 0
ambari-agent/src/main/puppet/modules/hdp-ganglia/files/gmondLib.sh

@@ -85,6 +85,17 @@ function getGmondPidFileName()
     fi
 }
 
+function removeGmondPidFileName()
+{
+    clusterName=${1};
+    gmondPidFileName=`getGmondPidFileName ${clusterName}`;
+    if [ -e "${gmondPidFileName}" ]; 
+     then
+      rm -rf ${gmondPidFileName};          
+    fi 
+}
+
+
 function getGmondLoggedPid()
 {
     gmondPidFile=`getGmondPidFileName ${1}`;

+ 1 - 1
ambari-agent/src/main/puppet/modules/hdp-ganglia/files/startGmond.sh

@@ -34,7 +34,7 @@ function startGmondForCluster()
     if [ -z "${gmondRunningPid}" ]
     then
       gmondCoreConfFileName=`getGmondCoreConfFileName ${gmondClusterName}`;
-
+      removeGmondPidFileName ${gmondClusterName};
       if [ -e "${gmondCoreConfFileName}" ]
       then 
         gmondPidFileName=`getGmondPidFileName ${gmondClusterName}`;

+ 1 - 0
ambari-agent/src/main/puppet/modules/hdp-ganglia/files/stopGmond.sh

@@ -34,6 +34,7 @@ function stopGmondForCluster()
     if [ -n "${gmondRunningPid}" ]
     then
       kill -KILL ${gmondRunningPid};
+      removeGmondPidFileName ${gmondClusterName};
       echo "Stopped ${GMOND_BIN} for cluster ${gmondClusterName} (with PID ${gmondRunningPid})";
     fi
 }