]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Merge with debug_V2_1_0a2
authorageay <ageay>
Mon, 29 Nov 2004 14:37:21 +0000 (14:37 +0000)
committerageay <ageay>
Mon, 29 Nov 2004 14:37:21 +0000 (14:37 +0000)
bin/runSalome.py
src/CASCatch/CASCatch_SignalsHandler.cxx
src/Session/SALOME_Session_Server.cxx

index cd8f45b127b462a9095a242459dde9f96737751d..122027e7c57e6e467f914479b4ffd3138592430f 100755 (executable)
@@ -179,7 +179,7 @@ from killSalome import killAllPorts
 def killLocalPort(args):
     """
     kill servers from a previous SALOME exection, if needed,
-    on the same CORBA port
+    on the CORBA port given in args of runSalome
     """
     
     from killSalomeWithPort import killMyPort
@@ -191,7 +191,21 @@ def killLocalPort(args):
         pass
     pass
     
+def givenPortKill(port):
+    """
+    kill servers from a previous SALOME exection, if needed,
+    on the same CORBA port
+    """
     
+    from killSalomeWithPort import killMyPort
+    my_port=port
+    try:
+        killMyPort(my_port)
+    except:
+        print "problem in LocalPortKill(), killMyPort("<<port<<")"
+        pass
+    pass
+
 def kill_salome(args):
     """
     Kill servers from previous SALOME executions, if needed;
@@ -202,7 +216,7 @@ def kill_salome(args):
     if args['killall']:
         killAllPorts()
     elif args['portkill']:
-        killLocalPort(args)
+        givenPortKill(str(args['port']))
        
 # -----------------------------------------------------------------------------
 #
@@ -246,7 +260,7 @@ class CatalogServer(Server):
         self.SCMD2=['-personal',
                     '${HOME}/Salome/resources/CatalogModulePersonnel.xml'] 
 
-    def setpath(self,modules_list):
+    def setpath(self,modules_list,modules_root_dir):
         cata_path=[]
         list_modules = modules_list[:]
         list_modules.reverse()
@@ -453,7 +467,7 @@ def startSalome(args, modules_list, modules_root_dir):
 
     if 'moduleCatalog' not in args['embedded']:
         cataServer=CatalogServer(args)
-        cataServer.setpath(modules_list)
+        cataServer.setpath(modules_list,modules_root_dir)
         cataServer.run()
         import SALOME_ModuleCatalog
         clt.waitNS("/Kernel/ModulCatalog",SALOME_ModuleCatalog.ModuleCatalog)
@@ -591,8 +605,10 @@ def useSalome(args, modules_list, modules_root_dir):
     To kill SALOME processes from a console (kill all sessions from all ports):
       python killSalome.py 
     To kill SALOME from the present interpreter, if it is not closed :
-      killLocalPort()  --> kill this session
-      killAllPorts()   --> kill all sessions
+      killLocalPort()      --> kill this session
+                               (use CORBA port from args of runSalome)
+      givenPortKill(port)  --> kill a specific session with given CORBA port 
+      killAllPorts()       --> kill all sessions
     
     runSalome, with --killall option, starts with killing
     the processes resulting from the previous execution.
index 68cbb04bcff0391aefc6b330dd78d3ed72173a46..d18c1af6bda146db932071829073e8667127fcd6 100644 (file)
 
 
 #include "CASCatch_SignalsHandler.h"
+#include <signal.h>
 #include <OSD.hxx>
 using namespace std;
 
 CASCatch_SignalsHandler::CASCatch_SignalsHandler(bool theFloatingSignal)
 {
   OSD::SetSignal(theFloatingSignal);
+  // To allow application kill when used in xterm, one must use default behavior
+  // with SIGHUP signal
+  Utils_SignalsHandler::SetSigHandler(SIGHUP,SIG_DFL);
 }
index c78fb6763ea9946b4b5499c6360e8f57563ebcf1..33d3440a3e61cb287b6fc9b6a485cee02256088b 100644 (file)
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
              }
            catch(std::exception& e)
              {
-               INFOS("run(): An exception has been caught");
+               INFOS("run(): An exception has been caught " <<e.what() );
                QApplication::restoreOverrideCursor();
                QAD_MessageBox::error1 ( (QWidget*)QAD_Application::getDesktop(),
                                        QObject::tr("ERR_ERROR"),