#
def killSalome():
- print "arret du serveur ContainersManager ==> arret des containers"
- import os
- import sys
- import string
- from omniORB import CORBA
- import CosNaming
- import SALOME
- import Engines
- import Containers
- try :
- orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
- obj = orb.resolve_initial_references("NameService")
- rootContext = obj._narrow(CosNaming.NamingContext)
- if rootContext is None:
- print "Name Service Reference is invalid"
- else :
- name = [CosNaming.NameComponent("Kernel","dir"),
- CosNaming.NameComponent("ContainersManager","object")]
- obj = rootContext.resolve( name )
- MyContainersMgr = obj._narrow(Containers.Manager)
- print "MyContainersMgr.ping :",MyContainersMgr.ping()
- MyContainersMgr.destroy()
- except :
- print "Cannot destroy the ContainersManager"
-
print "arret des serveurs SALOME"
for pid, cmd in process_id.items():
print "arret du process %s : %s"% (pid, cmd[0])
# -----------------------------------------------------------------------------
filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict'
+#filedict='/tmp/'+os.getlogin()+'_SALOME_pidict'
try:
fpid=open(filedict, 'r')
except:
#
def killSalome():
- print "arret du serveur ContainersManager ==> arret des containers"
- import os
- import sys
- import string
- from omniORB import CORBA
- import CosNaming
- import Engines
- import Resources
- import Containers
- try :
- orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
- obj = orb.resolve_initial_references("NameService")
- rootContext = obj._narrow(CosNaming.NamingContext)
- if rootContext is None:
- print "Name Service Reference is invalid"
- else :
- name = [CosNaming.NameComponent("Kernel","dir"),
- CosNaming.NameComponent("ContainersManager","object")]
- obj = rootContext.resolve( name )
- MyContainersMgr = obj._narrow(Containers.Manager)
- print "MyContainersMgr.ping :"
- MyContainersMgr.ping()
- print "MyContainersMgr.destroy :"
- MyContainersMgr.destroy()
- print "MyContainersMgr destroyed"
- except :
- print "Cannot destroy the ContainersManager"
-
print "arret des serveurs SALOME"
for pid, cmd in process_id.items():
print "arret du process %s : %s"% (pid, cmd[0])
class RegistryServer(Server):
CMD=['SALOME_Registry_Server', '--salome_session','theSession']
-class ResourcesServer(Server):
- CMD=['ResourcesManager_Server','-common',os.getenv('KERNEL_ROOT_DIR')+'/share/salome/resources/ResourcesCatalog.xml','-ORBInitRef','NameService=corbaname::localhost']
-
-class ContainersServer(Server):
- CMD=['ContainersManager_Server','-ORBInitRef','NameService=corbaname::localhost']
-
-class ContainerServer( Server) :
- def Params( self , HostName , ContainerName , ContainerType ) :
- self.CMD=['startContainer.py',str(with_xterm),HostName,ContainerName,ContainerType,'localhost','0']
+class ContainerCPPServer(Server):
+ CMD=['SALOME_Container','FactoryServer','-ORBInitRef','NameService=corbaname::localhost']
-#class ContainerCPPServer(Server):
- #CMD=['SALOME_Container','FactoryServer','-ORBInitRef','NameService=corbaname::localhost']
+class ContainerPYServer(Server):
+ CMD=['SALOME_ContainerPy.py','FactoryServerPy','-ORBInitRef','NameService=corbaname::localhost']
-#class ContainerPYServer(Server):
- #CMD=['SALOME_ContainerPy.py','FactoryServerPy','-ORBInitRef','NameService=corbaname::localhost']
-
-#class ContainerSUPERVServer(Server):
- #CMD=['SALOME_Container','SuperVisionContainer','-ORBInitRef','NameService=corbaname::localhost']
+class ContainerSUPERVServer(Server):
+ CMD=['SALOME_Container','SuperVisionContainer','-ORBInitRef','NameService=corbaname::localhost']
class LoggerServer(Server):
CMD=['SALOME_Logger_Server', 'logger.log']
theComputer = os.getenv("HOSTNAME")
computerSplitName = theComputer.split('.')
theComputer = computerSplitName[0]
- #CCRT
- import socket
- #theComputerAddr = socket.gethostbyname( theComputer )
- #print "theComputer :",theComputer,theComputerAddr,"HOSTNAME",os.getenv("HOSTNAME")
- #theComputer = theComputerAddr
- print "theComputer :",theComputer,socket.gethostbyname( theComputer ),"HOSTNAME",os.getenv("HOSTNAME")
-
- import Engines
- import Resources
- import Containers
-
- #
- # Lancement ResourcesManager Server
- #
-
- ResourcesServer().run()
-
- #
- # Attente de la disponibilité du ResourcesServer dans le Naming Service
- #
-
- session=clt.waitNS("/Kernel/ResourcesManager",Resources.Manager)
-
- #
- # Lancement ContainersManager Server
- #
-
- ContainersServer().run()
-
- #
- # Attente de la disponibilité du ContainersManager dans le Naming Service
- #
-
- MyContainersMgr = clt.waitNS("/Kernel/ContainersManager",Containers.Manager)
#
# Lancement Container C++ local
#
if with_container_cpp:
- FactoryServer = ContainerServer()
- FactoryServer.Params( theComputer , 'FactoryServer' , 'Engines.CppContainer' )
- FactoryServer.run()
+ ContainerCPPServer().run()
#
# Attente de la disponibilité du Container C++ local dans le Naming Service
#
if with_container_python:
- FactoryServerPy = ContainerServer()
- FactoryServerPy.Params( theComputer , 'FactoryServerPy' , 'Engines.PythonContainer' )
- FactoryServerPy.run()
+ ContainerPYServer().run()
#
# Attente de la disponibilité du Container Python local dans le Naming Service
#
FactoryServerPy = clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
- FactoryServerPy.ping()
if with_container_superv:
# Lancement Container Supervision local
#
- SuperVisionContainer = ContainerServer()
- SuperVisionContainer.Params( theComputer , 'SuperVisionContainer' , 'Engines.CppContainer' )
- SuperVisionContainer.run()
+ ContainerPYServer().run()
#
# Attente de la disponibilité du Container Supervision local dans le Naming Service
#