From bcf58b30551454184d067e79443e6358afb70618 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 14 Mar 2012 14:39:07 +0000 Subject: [PATCH] Improve killSalomeWithPort script: before killing the servers with kill command, give them chance to shutdown in a proper way --- bin/killSalomeWithPort.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index bcc148004..924bea48b 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -143,7 +143,30 @@ def killMyPort(port): Parameters: - port - port number """ - from salome_utils import getShortHostName, getHostName + from salome_utils import getShortHostName, getHostName, generateFileName + + # set OMNIORB_CONFIG variable to the proper file + home = os.getenv("HOME") + appli = os.getenv("APPLI") + kwargs = {} + if appli is not None: + home = os.path.join(home, appli,"USERS") + kwargs["with_username"]=True + pass + omniorb_config = generateFileName(home, prefix="omniORB", + extension="cfg", + hidden=True, + with_hostname=True, + with_port=port, + **kwargs) + os.environ['OMNIORB_CONFIG'] = omniorb_config + + # give the chance to the servers to shutdown properly + try: + import shutdownSalome + except: + pass + # new-style dot-prefixed pidict file filedict = getPiDict(port, hidden=True) # provide compatibility with old-style pidict file (not dot-prefixed) -- 2.39.2