2 import os, sys, pickle, signal, commands
4 ########## kills all salome processes with the given port ##########
6 filedict='/tmp/'+os.getenv('USER')+"_"+port+'_SALOME_pidict'
9 fpid=open(filedict, 'r')
12 print "le fichier %s des process SALOME n'est pas accessible"% filedict
16 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")
18 process_ids=pickle.load(fpid)
20 for process_id in process_ids:
22 for pid, cmd in process_id.items():
23 print "stop process %s : %s"% (pid, cmd[0])
25 os.kill(int(pid),signal.SIGKILL)
27 print " ------------------ process %s : %s inexistant"% (pid, cmd[0])
33 pid = commands.getoutput("ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"")
35 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")
36 pid = commands.getoutput("ps -eo pid,command | egrep \"[0-9] omniNames -start "+str(port)+"\" | sed -e \"s%[^0-9]*\([0-9]*\) .*%\\1%g\"")
39 if __name__ == "__main__":
40 for port in sys.argv[1:]: