comparison scripts/launcher/launch.sh @ 7:b01ee1b28680

launching script handles "salut" component
author souliane <souliane@mailoo.org>
date Thu, 24 Jul 2014 12:25:27 +0200
parents 19448ad3a7d9
children 7b337be4052d
comparison
equal deleted inserted replaced
6:19448ad3a7d9 7:b01ee1b28680
10 SAT=$WORKSPACE/sat 10 SAT=$WORKSPACE/sat
11 PYJS=$WORKSPACE/pyjamas 11 PYJS=$WORKSPACE/pyjamas
12 LIBERVIA=$WORKSPACE/libervia 12 LIBERVIA=$WORKSPACE/libervia
13 PROSODY=$WORKSPACE/prosody-hg 13 PROSODY=$WORKSPACE/prosody-hg
14 SATPUBSUB=$WORKSPACE/sat_pubsub 14 SATPUBSUB=$WORKSPACE/sat_pubsub
15 SALUT=$WORKSPACE/salut
15 URWID_SATEXT=$WORKSPACE/urwid_satext 16 URWID_SATEXT=$WORKSPACE/urwid_satext
16 17
17 # PIDs of the processes 18 # PIDs of the processes
18 LOCAL_DIR=~/.local/share/sat 19 LOCAL_DIR=~/.local/share/sat
19 SAT_PID=$LOCAL_DIR/sat.pid 20 SAT_PID=$LOCAL_DIR/sat.pid
20 LIB_PID=$LOCAL_DIR/libervia.pid 21 LIB_PID=$LOCAL_DIR/libervia.pid
21 SER_PID=$PROSODY/prosody.pid 22 SER_PID=$PROSODY/prosody.pid
22 SPS_PID=$SATPUBSUB/twistd.pid 23 SPS_PID=$SATPUBSUB/twistd.pid
24 SALUT_PID=$SALUT/twistd.pid
23 25
24 # Connection information for sat_pubsub 26 # Connection information for Prosody components
25 SPS_JID=sat-pubsub.tazar.int 27 SPS_JID=sat-pubsub.tazar.int
26 SPS_PWD=password 28 SPS_PWD=password
27 29
28 # Informations for a concurrent sat instance 30 # Informations for a concurrent sat instance
29 # For this to work, you have to follow the instructions in: 31 # For this to work, you have to follow the instructions in:
77 } 79 }
78 stop_ser() { 80 stop_ser() {
79 echo "############# Stopping Prosody ############" 81 echo "############# Stopping Prosody ############"
80 cd $PROSODY && if [[ -f $SER_PID ]]; then ./prosodyctl stop; fi 82 cd $PROSODY && if [[ -f $SER_PID ]]; then ./prosodyctl stop; fi
81 kill_process $SER_PID 83 kill_process $SER_PID
82 echo "########### Stopping sat_pubsub ###########" 84 echo "####### Stopping Prosody components #######"
83 kill_process $SPS_PID 85 kill_process $SPS_PID
86 kill_process $SALUT_PID
84 } 87 }
85 start_ser() { 88 start_ser() {
86 echo "############# Starting Prosody ############" 89 echo "############# Starting Prosody ############"
87 cd $PROSODY && ./prosodyctl start 90 cd $PROSODY && ./prosodyctl start
88 echo "########## Installing sat_pubsub ##########" 91 echo "########## Installing sat_pubsub ##########"
91 if [[ $SPS_DEBUG = 1 ]]; then 94 if [[ $SPS_DEBUG = 1 ]]; then
92 mate-terminal -e "twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD" & 95 mate-terminal -e "twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD" &
93 else 96 else
94 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD 97 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD
95 fi 98 fi
99 echo "############## Starting salut #############"
100 cd $SALUT && twistd -y salut.tac
96 } 101 }
97 start_sat() { 102 start_sat() {
98 echo "############## Installing sat #############" 103 echo "############## Installing sat #############"
99 cd $SAT && sudo python setup.py install 104 cd $SAT && sudo python setup.py install
100 echo "############### Starting sat ##############" 105 echo "############### Starting sat ##############"