Can't find a free port to launch omniNames
Hi every one,
I'm using Salome in an optimisation workfow so evere time I need to call it with a python script so basically this is the command in my shell script:
runSalome -t -u my_python_script.py
and this command is executed several time until my optimisation is done.
The problem that I get after a number of iteration the following error message:
searchFreePort(args, save_config)
File "/home/achraf/salome_6.5.0/KERNEL_6.5.0/bin/salome/runSalome.py", line 911, in searchFreePort
raise RuntimeError, msg
RuntimeError:
Can't find a free port to launch omniNames
Try to kill the running servers and then launch SALOME again.
So I guess that I need to add some command at the end of my python script in order to close salome and kill the current port without using the shell command!
Did any one know some commands that can do this?
Best regards
Achraf Soussi
Hello,
If you need to close running SALOME session in the end of your Python script execution, you can add something like below to the end of Python script:
import os
from killSalomeWithPort import killMyPort
killMyPort(os.getenv('NSPORT'))
Regards,
Vadim.
Hi Vadim,
thank you for your response. It seems to work even though I get this message:
th. 140709720225536 - Trace /dn47/SALOME/series6xDEV/KERNEL/Debian60-64/KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [1432] : Destroy_Directory(): CosNaming::NamingContext::NoEmpty /Study/ is not empty
th. 140709862664000 end of trace
th. 140053405837120 end of trace
th. 140035581343552 end of trace
th. 140092487640896 end of trace
Cannot find or open SALOME PIDs file for port 2810
Do you know what does this mean?
Best regards
Achraf Soussi
Hello Achraf,
Mentioned warning is not fatal, so you can use proposed approach. However, it refers to the bug of killSalomeWithPort.py script (some SALOME processes might be not killed).
What version of SALOME do you use? I suppose this is 6.5.0, since in 6.6.0 mentioned bug has been fixed.
Regards,
Vadim.

