From a190cf1717d3f058f475d72c34c8b1b5e1b895f8 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 27 Nov 2006 11:53:39 +0000 Subject: [PATCH] Modifications for CCRT cluster: use .omniORB_last.cfg instead of .omniORB_{host}_last.cfg --- bin/appliskel/killCurrentPort | 5 ++--- bin/appliskel/runSession | 5 ++--- bin/appliskel/searchFreePort.sh | 2 +- bin/killSalomeWithPort.py | 4 ++-- bin/runSalome.py | 6 +++++- bin/salome_session.py | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bin/appliskel/killCurrentPort b/bin/appliskel/killCurrentPort index 5d0a547cc..e1eb19268 100755 --- a/bin/appliskel/killCurrentPort +++ b/bin/appliskel/killCurrentPort @@ -10,11 +10,10 @@ # --- find omniORB configuration relative to current session if any -myhost=`hostname` -fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg +fileOmniConfig=${HOME}/${APPLI}/.omniORB_last.cfg if [ -f $fileOmniConfig ]; then - OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_last.cfg export OMNIORB_CONFIG fi diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession index 69573bf10..9f3b0e4f9 100755 --- a/bin/appliskel/runSession +++ b/bin/appliskel/runSession @@ -17,11 +17,10 @@ APPLI_HOME=`dirname $0` # --- set omniORB configuration to current session if any -myhost=`hostname` -fileOmniConfig=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg +fileOmniConfig=${HOME}/${APPLI}/.omniORB_last.cfg if [ -f $fileOmniConfig ]; then - OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_last.cfg export OMNIORB_CONFIG # --- set environment variables for port and hostname of NamingService diff --git a/bin/appliskel/searchFreePort.sh b/bin/appliskel/searchFreePort.sh index d63804500..a45eb4dea 100755 --- a/bin/appliskel/searchFreePort.sh +++ b/bin/appliskel/searchFreePort.sh @@ -41,7 +41,7 @@ searchFreePort() { local initref="NameService=corbaname::"`hostname`":$NSPORT" #echo "ORBInitRef $initref" > $OMNIORB_CONFIG echo "InitRef = $initref" > $OMNIORB_CONFIG - LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_${myhost}_last.cfg + LAST_RUNNING_CONFIG=${HOME}/${APPLI}/.omniORB_last.cfg export LAST_RUNNING_CONFIG rm ${LAST_RUNNING_CONFIG} ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG} diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 2bfec7561..60e166d15 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -46,7 +46,7 @@ def appliCleanOmniOrbConfig(port): """ remove omniorb config files related to the port in SALOME application: - ${HOME}/${APPLI}/.omniORB_${HOSTNAME}_${NSPORT}.cfg - - ${HOME}/${APPLI}/.omniORB_${HOSTNAME}_last.cfg + - ${HOME}/${APPLI}/.omniORB_last.cfg the last is removed only if the link points to the first file. """ from Utils_Identity import getShortHostName @@ -59,7 +59,7 @@ def appliCleanOmniOrbConfig(port): home='%s/%s'%(home,appli) hostname=getShortHostName() omniorb_config = '%s/.omniORB_%s_%s.cfg'%(home,hostname, str(port)) - last_running_config = '%s/.omniORB_%s_last.cfg'%(home, hostname) + last_running_config = '%s/.omniORB_last.cfg'%(home) if os.access(last_running_config,os.F_OK): pointedPath = os.readlink(last_running_config) if pointedPath[0] != '/': diff --git a/bin/runSalome.py b/bin/runSalome.py index c62a0aee9..424c00e32 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -887,6 +887,10 @@ def searchFreePort(args, save_config=0): system('rm -f %s'%(tmp_file)) # home = os.environ['HOME'] + appli=os.environ.get("APPLI") + if appli is not None: + home='%s/%s'%(home,appli) + pass # os.environ['OMNIORB_CONFIG'] = '%s/.omniORB_%s_%s.cfg'%(home, myhost, NSPORT) initref = "NameService=corbaname::%s:%s"%(myhost, NSPORT) @@ -903,7 +907,7 @@ def searchFreePort(args, save_config=0): # if save_config: from os import system - system('ln -sf %s %s/.omniORB_current.cfg'%(os.environ['OMNIORB_CONFIG'], home)) + system('ln -sf %s %s/.omniORB_last.cfg'%(os.environ['OMNIORB_CONFIG'], home)) pass # break diff --git a/bin/salome_session.py b/bin/salome_session.py index d43e144a7..870b53bc4 100644 --- a/bin/salome_session.py +++ b/bin/salome_session.py @@ -63,7 +63,7 @@ def searchFreePort(): f = open(omniorb_config, "w") f.write("ORBInitRef NameService=corbaname::%s:%s\n"%(hostname, NSPORT)) f.close() - last_running_config = '%s/.omniORB_%s_last.cfg'%(home, hostname) + last_running_config = '%s/.omniORB_last.cfg'%(home, hostname) os.environ['LAST_RUNNING_CONFIG'] = last_running_config if os.access(last_running_config,os.F_OK): os.unlink(last_running_config) -- 2.39.2