X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLifeCycleCORBA%2FSALOME_LifeCycleCORBA.cxx;h=75bf0dd5ee72f618b6f6560013141cb96770c096;hb=f932433e7396f9be950f617c50c9b15db1a33be1;hp=19e66e5e10943143ef8e557c07b8ced5f94b6469;hpb=ec953d7309b78fa23dc8a0e70ad22a3c81f72e49;p=modules%2Fyacs.git diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 19e66e5e1..75bf0dd5e 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -597,54 +597,38 @@ void SALOME_LifeCycleCORBA::shutdownServers() void SALOME_LifeCycleCORBA::killOmniNames() { std::string portNumber (::getenv ("NSPORT") ); - if ( !portNumber.empty() ) - { -#ifdef WIN32 -#else - std::string cmd ; - cmd = std::string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*") - + portNumber - + std::string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" ); - MESSAGE(cmd); - try { - system ( cmd.c_str() ); - } - catch ( ... ) { - } -#endif - } - std::string python_exe; python_exe = std::string("python"); -#ifdef WIN32 - #ifdef _DEBUG_ - python_exe += std::string("_d"); - #endif -#endif if ( !portNumber.empty() ) { - std::string cmd = ("from killSalomeWithPort import cleanApplication; "); + std::string cmd; + + cmd = std::string("from salome_utils import killOmniNames; "); + cmd += std::string("killOmniNames(") + portNumber + "); "; + cmd = python_exe + std::string(" -c \"") + cmd +"\""; + MESSAGE(cmd); + system( cmd.c_str() ); + + cmd = std::string("from killSalomeWithPort import cleanApplication; "); cmd += std::string("cleanApplication(") + portNumber + "); "; - //cmd = python_exe + std::string(" -c \"") + cmd +"\" > /dev/null 2> /dev/null"; cmd = python_exe + std::string(" -c \"") + cmd +"\""; MESSAGE(cmd); system( cmd.c_str() ); } -#ifdef WITH_PORTMANAGER // shutdown portmanager if ( !portNumber.empty() ) { - std::string cmd = ("from PortManager import releasePort; "); + std::string cmd; + + cmd = std::string("from PortManager import releasePort; "); cmd += std::string("releasePort(") + portNumber + "); "; - //cmd = python_exe + std::string(" -c \"") + cmd +"\" > /dev/null 2> /dev/null"; cmd = python_exe + std::string(" -c \"") + cmd +"\""; MESSAGE(cmd); system( cmd.c_str() ); } -#endif } //=============================================================================