Salome HOME
Merge from V6_main 13/12/2012
[modules/kernel.git] / bin / runNS.sh
1 #!/bin/sh 
2 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 #log files localization
25 #
26 BaseDir=/tmp
27 Username=`/usr/bin/whoami`
28
29 # kill OmniNames if exists
30
31 #killall -q -9 omniNames
32
33 # clear log files
34
35 mkdir -m 777 ${BaseDir}/logs 
36 mkdir ${BaseDir}/logs/${Username}
37 touch ${BaseDir}/logs/${Username}/dummy
38 \rm -f ${BaseDir}/logs/${Username}/omninames* ${BaseDir}/logs/${Username}/dummy ${BaseDir}/logs/${Username}/*.log
39
40 echo "Name Service... "
41 aSedCommand="s/.*NameService=corbaname::`hostname`:\([[:digit:]]*\)/\1/"
42 aPort=`cat $OMNIORB_CONFIG | grep NameService | sed -e"$aSedCommand"`
43 omniNames -start $aPort -logdir ${BaseDir}/logs/${Username} &
44
45 # In LifeCycleCORBA, FactoryServer is started with rsh on the requested
46 #    computer if this Container does not exist. Default is localhost.
47 #    Others Containers are started with start_impl method of FactoryServer Container.
48 # For using rsh it is necessary to have in the ${HOME} directory a .rhosts file
49 # Warning : on RedHat the file /etc/hosts contains by default a line like :
50 # 127.0.0.1               bordolex bordolex.paris1.matra-dtv.fr localhost.localdomain localhost  
51 #   (bordolex is the station name). omniNames on bordolex will be accessible from other
52 #   computers only if the computer name is removed on that line like :
53 #   127.0.0.1               bordolex.paris1.matra-dtv.fr localhost.localdomain localhost
54
55 # To start dynamically Containers on several computers you need to
56 # put in the ${OMNIORB_CONFIG} file a computer name instead of "localhost"
57 # example : ORBInitRef NameService=corbaname::dm2s0017
58
59 # If you need to use several omniNames running on the same computer, you have to :
60 #1. put in your ${OMNIORB_CONFIG} file a computer name and port number
61 # example : ORBInitRef NameService=corbaname::dm2s0017:1515
62 #2. start omninames with this port number in runNS.sh
63 # example : omniNames -start 1515 -logdir ${BaseDir}/logs/${Username} &
64
65 echo ok
66 echo "to list contexts and objects bound int the context with the specified name : showNS "