From 9ef9341cb683cdecd110414e1b4fba0d85f92365 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Tue, 15 Apr 2014 11:34:31 +0200 Subject: [PATCH] remove notification server --- bin/appliskel/runSalomeScript | 3 ++- bin/killSalomeWithPort.py | 13 +++------- bin/parseConfigFile.py | 2 -- bin/runSalome.py | 24 ------------------- bin/server.py | 6 ++--- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 10 ++++---- src/LifeCycleCORBA/Test/TestLifeCycleCORBA.py | 5 ---- .../Test/TestLifeCycleCORBA_SWIG.py | 5 ---- src/UnitTests/UnitTests.py | 7 +----- 9 files changed, 12 insertions(+), 63 deletions(-) diff --git a/bin/appliskel/runSalomeScript b/bin/appliskel/runSalomeScript index be512f8ab..b50ed6517 100755 --- a/bin/appliskel/runSalomeScript +++ b/bin/appliskel/runSalomeScript @@ -137,7 +137,8 @@ def copy_files(user,machine,script,infiles,outfiles,directory): """modify script, copy files to remote computer and return lists of copied files""" namescript=os.path.basename(script) - logname=os.getenv("LOGNAME",user) + import getpass + logname = getpass.getuser() tmp_script="/tmp/%s_%s_%s" % (logname,os.getpid(),namescript) fscript=open(script) script_text=fscript.read() diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 040a27f4e..d2f5c8443 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -193,7 +193,7 @@ def shutdownMyPort(port, cleanup=True): lcc.shutdownServers() # give some time to shutdown to complete time.sleep(1) - # shutdown omniNames and notifd + # shutdown omniNames if cleanup: lcc.killOmniNames() time.sleep(1) @@ -323,21 +323,14 @@ def killMyPort(port): appliCleanOmniOrbConfig(port) pass -def killNotifdAndClean(port): +def cleanApplication(port): """ - Kill notifd daemon and clean application running on the specified port. + Clean application running on the specified port. Parameters: - port - port number """ try: filedict=getPiDict(port) - with open(filedict, 'r') as f: - pids=pickle.load(f) - for d in pids: - for pid,process in d.items(): - if 'notifd' in process: - cmd='kill -9 %d'% pid - os.system(cmd) os.remove(filedict) except: #import traceback diff --git a/bin/parseConfigFile.py b/bin/parseConfigFile.py index 7590fbaf3..c6f082595 100644 --- a/bin/parseConfigFile.py +++ b/bin/parseConfigFile.py @@ -285,8 +285,6 @@ class EnvFileConverter(object): line = ADD_TO_PREFIX + k + ": " + value # Update list of variable names # :TODO: define excludeBlock variable (similar to exclude) and provide method to extend it - if line.startswith("LOGNAME="): - return "\n" if "cleandup()" in line: print "WARNING: parseConfigFile.py: skip cleandup and look for '# PRODUCT environment'" while True: diff --git a/bin/runSalome.py b/bin/runSalome.py index 63652278c..fa94cbe3e 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -393,21 +393,6 @@ class LauncherServer(Server): self.CMD=self.SCMD1 + ['"' + string.join(cata_path,'"::"') + '"'] + self.SCMD2 else: self.CMD=self.SCMD1 + self.SCMD2 - -class NotifyServer(Server): - def __init__(self,args,modules_root_dir): - self.args=args - self.initArgs() - self.modules_root_dir=modules_root_dir - myLogName = os.environ["LOGNAME"] - self.CMD=['notifd','-c', - self.modules_root_dir["KERNEL"] +'/share/salome/resources/kernel/channel.cfg', - '-DFactoryIORFileName=/tmp/'+myLogName+'_rdifact.ior', - '-DChannelIORFileName=/tmp/'+myLogName+'_rdichan.ior', - '-DReportLogFile=/tmp/'+myLogName+'_notifd.report', - '-DDebugLogFile=/tmp/'+myLogName+'_notifd.debug', - ] - # # ----------------------------------------------------------------------------- @@ -500,15 +485,6 @@ def startSalome(args, modules_list, modules_root_dir): myServer.run() clt.waitLogger("Logger") - # Notify Server launch - # - - if sys.platform != "win32": - if verbose(): print "Notify Server to launch" - - myServer=NotifyServer(args,modules_root_dir) - myServer.run() - # set siman python path before the session server launching to import scripts inside python console if simanStudyName(args): # MPV: use os.environ here because session server is launched in separated process and sys.path is missed in this case diff --git a/bin/server.py b/bin/server.py index 8caa1acbf..c01e52789 100755 --- a/bin/server.py +++ b/bin/server.py @@ -33,7 +33,7 @@ process_id = {} class Server: """Generic class for CORBA server launch""" - + server_launch_mode = "daemon" def initArgs(self): @@ -133,7 +133,5 @@ class Server: try: os.execvp(args[0], args) except OSError, e: - if args[0] != "notifd": - print >>sys.stderr, "(%s) launch failed: %d (%s)" % (args[0],e.errno, e.strerror) - pass + print >>sys.stderr, "(%s) launch failed: %d (%s)" % (args[0],e.errno, e.strerror) os._exit(127) diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 1e4c010b7..1bfdd89cc 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -421,7 +421,7 @@ Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager() } //============================================================================= -/*! \brief shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd +/*! \brief shutdown all the SALOME servers except SALOME_Session_Server and omniNames */ //============================================================================= @@ -587,7 +587,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() } //============================================================================= -/*! \brief shutdown omniNames and notifd +/*! \brief shutdown omniNames */ //============================================================================= @@ -611,8 +611,6 @@ void SALOME_LifeCycleCORBA::killOmniNames() #endif } - // NPAL 18309 (Kill Notifd) - std::string python_exe; python_exe = std::string("python"); @@ -624,8 +622,8 @@ void SALOME_LifeCycleCORBA::killOmniNames() if ( !portNumber.empty() ) { - std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; "); - cmd += std::string("killNotifdAndClean(") + portNumber + "); "; + std::string cmd = ("from killSalomeWithPort import cleanApplication; "); + cmd += std::string("cleanApplication(") + portNumber + "); "; cmd = python_exe + std::string(" -c \"") + cmd +"\" > /dev/null 2> /dev/null"; MESSAGE(cmd); system( cmd.c_str() ); diff --git a/src/LifeCycleCORBA/Test/TestLifeCycleCORBA.py b/src/LifeCycleCORBA/Test/TestLifeCycleCORBA.py index 45ea3ec34..0dbc8625f 100644 --- a/src/LifeCycleCORBA/Test/TestLifeCycleCORBA.py +++ b/src/LifeCycleCORBA/Test/TestLifeCycleCORBA.py @@ -50,11 +50,6 @@ myServer=runSalome.LoggerServer(args) myServer.run() clt.waitLogger("Logger") -# launch notify server - -myServer=runSalome.NotifyServer(args,modules_root_dir) -myServer.run() - # launch registry server myServer=runSalome.RegistryServer(args) diff --git a/src/LifeCycleCORBA_SWIG/Test/TestLifeCycleCORBA_SWIG.py b/src/LifeCycleCORBA_SWIG/Test/TestLifeCycleCORBA_SWIG.py index d4e5560ce..089cfeae5 100644 --- a/src/LifeCycleCORBA_SWIG/Test/TestLifeCycleCORBA_SWIG.py +++ b/src/LifeCycleCORBA_SWIG/Test/TestLifeCycleCORBA_SWIG.py @@ -55,11 +55,6 @@ myServer=runSalome.LoggerServer(args) myServer.run() clt.waitLogger("Logger") -# launch notify server - -myServer=runSalome.NotifyServer(args,modules_root_dir) -myServer.run() - # launch registry server myServer=runSalome.RegistryServer(args) diff --git a/src/UnitTests/UnitTests.py b/src/UnitTests/UnitTests.py index e6663f5ed..fa6f91e2a 100644 --- a/src/UnitTests/UnitTests.py +++ b/src/UnitTests/UnitTests.py @@ -49,11 +49,6 @@ myServer=runSalome.LoggerServer(args) myServer.run() clt.waitLogger("Logger") -# launch notify server - -myServer=runSalome.NotifyServer(args,modules_root_dir) -myServer.run() - # launch registry server myServer=runSalome.RegistryServer(args) @@ -85,6 +80,6 @@ import Engines launcher = clt.waitNS("/SalomeLauncher",Engines.SalomeLauncher) launcher.Shutdown() -# kill Test process +# kill Test process TestKiller.killProcess(runSalome.process_id) -- 2.39.2