2 import sys, os,signal,string,commands
4 def killNamingService():
6 kills omniORB4 Naming Service on local machine.
7 Selects process corresponding to the port used in $OMNIORB_CONFIG file.
8 Works only with a single line $OMNIORB_CONFIG like
9 InitRef = NameService=corbaname::<hostname>:<port>
11 fic=os.environ['OMNIORB_CONFIG']
15 port=string.split(line,':')[-1][0:4]
16 command='ps -eo pid,command | grep "omniNames -start '+str(port)+'"'
17 pid=string.split(commands.getoutput(command))[0]
18 os.kill(int(pid),signal.SIGKILL)
21 def killProcess(process_id):
23 kills process on local machine, given a dictionary of running process
24 generated by runSalome.Server() class and derived, (method run).
25 kills also local Naming server.
27 for pid, cmd in process_id.items():
28 print "stop process %s : %s"% (pid, cmd[0])
30 os.kill(int(pid),signal.SIGKILL)
32 print " ---- process %s : %s inexistant"% (pid, cmd[0])