Back to index

salome-kernel  6.5.0
Functions
TestKiller Namespace Reference

Functions

def killNamingService
def killProcess

Function Documentation

kills omniORB4 Naming Service on local machine.
Selects process corresponding to the port used in $OMNIORB_CONFIG file.
Works only with a single line $OMNIORB_CONFIG like
InitRef = NameService=corbaname::<hostname>:<port>

Definition at line 26 of file TestKiller.py.

00026 
00027 def killNamingService():
00028     """
00029     kills omniORB4 Naming Service on local machine.
00030     Selects process corresponding to the port used in $OMNIORB_CONFIG file.
00031     Works only with a single line $OMNIORB_CONFIG like
00032     InitRef = NameService=corbaname::<hostname>:<port>
00033     """
00034     fic=os.environ['OMNIORB_CONFIG']
00035     f=open(fic,'r')
00036     line=f.readline()
00037     f.close()
00038     port=string.split(line,':')[-1][0:4]
00039     command='ps -eo pid,command | grep "omniNames -start '+str(port)+'"'
00040     pid=string.split(commands.getoutput(command))[0]
00041     os.kill(int(pid),signal.SIGKILL)
00042 

Here is the caller graph for this function:

def TestKiller.killProcess (   process_id)
kills process on local machine, given a dictionary of running process
generated by runSalome.Server() class and derived, (method run).
kills also local Naming server.

Definition at line 43 of file TestKiller.py.

00043 
00044 def killProcess(process_id):
00045     """
00046     kills process on local machine, given a dictionary of running process
00047     generated by runSalome.Server() class and derived, (method run).
00048     kills also local Naming server.
00049     """
00050     for pid, cmd in process_id.items():
00051         print "stop process %s : %s"% (pid, cmd[0])
00052         try:
00053             os.kill(int(pid),signal.SIGKILL)
00054         except:
00055             print "  ---- process %s : %s inexistant"% (pid, cmd[0])
00056             pass
00057         del process_id[pid]
00058         pass
00059     killNamingService()

Here is the call graph for this function: