From: rahuel Date: Mon, 8 Nov 2004 09:22:15 +0000 (+0000) Subject: Restore without ContainersManager & ContainersManager X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5cf8dd49e535c957714774fab064473ace5ae78e;p=modules%2Fkernel.git Restore without ContainersManager & ContainersManager --- diff --git a/bin/killSalome.py b/bin/killSalome.py index e149ac31c..82d2ab3b2 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -10,31 +10,6 @@ process_id={} # 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]) @@ -48,6 +23,7 @@ def killSalome(): # ----------------------------------------------------------------------------- filedict='/tmp/'+os.getenv('USER')+'_SALOME_pidict' +#filedict='/tmp/'+os.getlogin()+'_SALOME_pidict' try: fpid=open(filedict, 'r') except: diff --git a/bin/orbmodule.py b/bin/orbmodule.py index 8ac737fa2..0dabe5a84 100755 --- a/bin/orbmodule.py +++ b/bin/orbmodule.py @@ -27,8 +27,6 @@ class NamingServer(Server): LOGDIR="/tmp/logs/" + USER os.system("mkdir -m 777 -p " + LOGDIR) #CCRTCMD="runNS.sh > " + LOGDIR + "/salomeNS.log 2>&1" - #CCRTCMD="runNS.sh > " + LOGDIR + "/salomeNS.log" - #print "NamingServer(Server)",CMD # ----------------------------------------------------------------------------- @@ -47,7 +45,6 @@ class client: obj = self.orb.resolve_initial_references("NameService") try: self.rootContext = obj._narrow(CosNaming.NamingContext) - print "Naming Service exists but perhaps on an other host (Alpha-OSF(CCRT) !", return except CORBA.COMM_FAILURE: self.rootContext = None @@ -73,7 +70,7 @@ class client: if self.rootContext is None: print "Failed to narrow the root naming context" sys.exit(1) - print "Naming Service found in %s seconds " % ((ncount-1)*delta) + print " found in %s seconds " % ((ncount-1)*delta) # -------------------------------------------------------------------------- diff --git a/bin/runNS.sh b/bin/runNS.sh index 226bc9be6..824bfb6c5 100755 --- a/bin/runNS.sh +++ b/bin/runNS.sh @@ -11,13 +11,12 @@ Username=`/usr/bin/whoami` # clear log files -mkdir -m 775 ${BaseDir}/logs +mkdir -m 777 ${BaseDir}/logs mkdir ${BaseDir}/logs/${Username} touch ${BaseDir}/logs/${Username}/dummy \rm -f ${BaseDir}/logs/${Username}/omninames* ${BaseDir}/logs/${Username}/dummy ${BaseDir}/logs/${Username}/*.log echo "Name Service... " - omniNames -start -logdir ${BaseDir}/logs/${Username} & # In LifeCycleCORBA, FactoryServer is started with rsh on the requested diff --git a/bin/runSalome.py b/bin/runSalome.py index 8333594ae..a984e4d4f 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -22,34 +22,6 @@ usage="""USAGE: runSalome.py [options] # 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]) @@ -220,24 +192,14 @@ class SalomeDSServer(Server): 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'] @@ -460,48 +422,12 @@ def startSalome(): 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 @@ -514,16 +440,13 @@ def startSalome(): # 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: @@ -531,9 +454,7 @@ def startSalome(): # 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 #