]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Double check if SM is running added. Some redundant output removed from SM
authorjniedzie <jeremi.niedziela@cern.ch>
Thu, 19 Feb 2015 09:57:02 +0000 (10:57 +0100)
committerjniedzie <jeremi.niedziela@cern.ch>
Thu, 19 Feb 2015 09:57:02 +0000 (10:57 +0100)
MONITOR/MONITORzmq/AliCommunicationThread.cxx
MONITOR/alistoragemanager/alistorage.cxx

index c346566790982086268553a9cd8cbb39c3a97413..80272ed65231c65210134683bb877429e9716fc1 100644 (file)
@@ -46,7 +46,6 @@ void AliCommunicationThread::CommunicationHandle()
     
     while(!fFinished)
     {
-        cout<<"COMMUNICATION -- waiting for requests"<<endl;
         request = eventManager->GetClientStruct(socket,5000);
         
         if(request)
@@ -92,7 +91,7 @@ void AliCommunicationThread::CommunicationHandle()
             }
             delete request;
         }
-        else{cout<<"COMMUNICATION -- received NO request"<<endl;}
+        else{sleep(1);}
     }
 }
 
index ca9f1ab488cea17812dbec8bd58eab8468f10fbe..c04bc09403be69c62788ee50ff3d573d5e6f4313 100644 (file)
@@ -28,6 +28,8 @@ void *ServerThreadHandle(void*)
 bool isStorageRunning()
 {
  // check if there is events server already running
+
+  // first mathod with pidof
   const char *pid = gSystem->GetFromPipe("pidof alistorage").Data();
   int pidSize = gSystem->GetFromPipe("pidof alistorage").Sizeof();
   std::string pidOfAll(pid,pidSize);
@@ -36,6 +38,12 @@ bool isStorageRunning()
   std::string word;
   while( pidStream >> word ) ++word_count;
   if(word_count != 1){return true;}
+  
+  // second method with ps
+  cout<<"checking if alistorage is running with ps"<<endl;
+  TString psName = gSystem->GetFromPipe("ps -e -o comm | grep alistorage");
+  if(strcmp(psName.Data(),"alistorage")>0){return true;}
+
   return false;
 }