Salome HOME
This commit was generated by cvs2git to create branch 'OCC_Config'.
[modules/kernel.git] / bin / runSalome
1 #!/bin/bash
2
3 searchFreePort() {
4     echo -n "Searching for a free port for naming service: "
5     export NSPORT=2810
6     local limit=$NSPORT
7     let limit=limit+100
8     while [ 1 ]
9     do
10         aRes=`netstat -ltn | grep -E :${NSPORT}`
11         if [ -z "$aRes" ]; then
12             echo ${NSPORT} - Ok
13             local myhost=`hostname`
14             export OMNIORB_CONFIG=${HOME}/.omniORB_${myhost}_${NSPORT}.cfg
15             local initref="NameService=corbaname::"`hostname`":$NSPORT"
16             export NSPORT
17             if [[ `python -c "import CORBA; print CORBA.ORB_ID"` == "omniORB4" ]]; then
18                 echo "InitRef = $initref" > $OMNIORB_CONFIG
19             else
20                 echo "ORBInitRef $initref" > $OMNIORB_CONFIG
21             fi
22             break
23         fi
24         echo -n "${NSPORT} "
25         if [[ $NSPORT -eq $limit ]] ; then
26             echo
27             echo "Can't find a free port to launch omniNames"
28             echo "Try to kill the running servers and then launch SALOME again."
29             exit
30         fi
31         let NSPORT=NSPORT+1
32     done
33 }
34
35 searchFreePort
36
37 if [[ "$*" == "-nothing" ]]; then
38     echo "port:$NSPORT"
39 elif [ $# -ne 0 ] ; then
40     python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
41 else
42     python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py
43 fi
44
45 # -----------------------------------------------------------------------------
46 # examples:
47 # ---------
48 #  $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome
49 #
50 #     - parameters for launching are taken from $HOME/.salome/salome.launch;
51 #     - if the config file does not exist, it is created with default values.
52 #
53 #  
54 #  $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome --modules=GEOM,SMESH,VISU,SUPERV,MED --embedded=registry,study,moduleCatalog,cppContainer --standalone=pyContainer,supervContainer --xterm --killall
55 #
56 #     parameters from command line supersede those from $HOME/.salome/salome.launch
57 #
58 # Some CORBA servers can be launched in the SALOME_Session_Server's process
59 # (embedded = same process) or in a separate process (standalone):
60 # --> registry,study,moduleCatalog,cppContainer
61 # Other CORBA servers could only be launched in separate process (standalone):
62 # --> pyContainer,supervContainer
63 #
64 # $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome -h
65 #    help
66 # -----------------------------------------------------------------------------
67 #
68 # l'option -i permet de garder l'interpreteur python ouvert :
69 # par defaut, les differents serveurs ouvrent des fenĂȘtres xterm
70 # (cf. runSalome.py)
71 # le serveur Logger n'est pas obligatoire (commentĂ© dans runSalome.py)
72
73 # -----------------------------------------------------------------------------