From 12fb90bd5227ec4b9f75ecf6c02120637aff5598 Mon Sep 17 00:00:00 2001 From: rahuel Date: Thu, 9 Feb 2006 15:06:11 +0000 Subject: [PATCH] kill of omniNames --- bin/killSalomeWithPort.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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() -- 2.39.2