From: rahuel Date: Thu, 9 Feb 2006 15:06:11 +0000 (+0000) Subject: kill of omniNames X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12fb90bd5227ec4b9f75ecf6c02120637aff5598;p=modules%2Fkernel.git kill of omniNames --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index e52a25f88..9f0cd0dd9 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -34,7 +34,21 @@ def killMyPort(port): pass if found: - a = os.system("pid=`ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"`; kill -9 $pid >& /dev/null") + cmd = 'pid=`ps -eo pid,command | egrep "[0-9] omniNames -start '+str(port)+'"` ; echo $pid > /tmp/logs/'+os.getenv('USER')+"/_"+port+'_Pid_omniNames.log' + a = os.system(cmd) + try: + fpidomniNames=open('/tmp/logs/'+os.getenv('USER')+"/_"+port+'_Pid_omniNames.log') + prc = fpidomniNames.read() + fpidomniNames.close() + if prc != None : + for field in prc.split(" ") : + if field == "omniNames" : + if pidfield != "egrep" : + print 'stop process '+pidfield+' : omniNames' + os.system('kill -9 '+pidfield) + pidfield = field + except: + pass try: process_ids=pickle.load(fpid) fpid.close()