comparison scripts/launcher/launch.sh @ 122:4cd5475623eb

scripts (launcher, test_accounts): update
author souliane <souliane@mailoo.org>
date Tue, 01 Dec 2015 16:23:14 +0100
parents fe116a11199b
children
comparison
equal deleted inserted replaced
121:d493fe1cf095 122:4cd5475623eb
23 LIB_PID=$LOCAL_DIR/libervia.pid 23 LIB_PID=$LOCAL_DIR/libervia.pid
24 SER_PID=$PROSODY/prosody.pid 24 SER_PID=$PROSODY/prosody.pid
25 SPS_PID=$SATPUBSUB/twistd.pid 25 SPS_PID=$SATPUBSUB/twistd.pid
26 SALUT_PID=$SALUT/twistd.pid 26 SALUT_PID=$SALUT/twistd.pid
27 27
28 # Services host
29 SERVICE=libervia
30
28 # Connection information for Prosody components 31 # Connection information for Prosody components
29 SPS_JID=sat-pubsub.tazar.int 32 SPS_JID=sat-pubsub.$SERVICE
30 SPS_PWD=password 33 SPS_PWD=password
31 34
32 # Informations for a concurrent sat instance 35 # Informations for a concurrent sat instance
33 # For this to work, you have to follow the instructions in: 36 # For this to work, you have to follow the instructions in:
34 # http://wiki.goffi.org/wiki/Howto_launch_several_S%C3%A0T_instances 37 # http://wiki.goffi.org/wiki/Howto_launch_several_S%C3%A0T_instances
50 # Launch sat pubsub in debug mode? 53 # Launch sat pubsub in debug mode?
51 SPS_DEBUG=0 54 SPS_DEBUG=0
52 # Launch salut in debug mode? 55 # Launch salut in debug mode?
53 SALUT_DEBUG=0 56 SALUT_DEBUG=0
54 # Launch libervia in debug mode? 57 # Launch libervia in debug mode?
55 LIB_DEBUG=1 58 LIB_DEBUG=0
56 # Force killing processes? 59 # Force killing processes?
57 KILL_FORCE=1 60 KILL_FORCE=1
58 61
59 62
60 kill_process() { 63 kill_process() {
113 kill_process $SER_PID 116 kill_process $SER_PID
114 echo "####### Stopping Prosody components #######" 117 echo "####### Stopping Prosody components #######"
115 stop_sps 118 stop_sps
116 stop_salut 119 stop_salut
117 echo "####### Stopping bind9 #######" 120 echo "####### Stopping bind9 #######"
118 sudo /etc/init.d/bind9 stop 121 sudo /etc/init.d/bind9 stop 2> /dev/null || echo "bind9 not installed?"
119 122
120 } 123 }
121 124
122 start_sps() { 125 start_sps() {
123 echo "########### Starting sat-pubsub ###########" 126 echo "########### Starting sat-pubsub ###########"
124 cd $SATPUBSUB 127 cd $SATPUBSUB
125 if [[ $SPS_DEBUG = 1 ]]; then 128 if [[ $SPS_DEBUG = 1 ]]; then
126 debug_console twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD 129 debug_console twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD
127 else 130 else
128 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD 131 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD #-v
129 fi 132 fi
130 } 133 }
131 134
132 start_salut() { 135 start_salut() {
133 echo "############## Starting salut #############" 136 echo "############## Starting salut #############"
143 echo "############# Starting Prosody ############" 146 echo "############# Starting Prosody ############"
144 cd $PROSODY && ./prosodyctl start & 147 cd $PROSODY && ./prosodyctl start &
145 start_sps 148 start_sps
146 start_salut 149 start_salut
147 echo "############## Starting bind9 #############" 150 echo "############## Starting bind9 #############"
148 sudo /etc/init.d/bind9 restart 151 sudo /etc/init.d/bind9 restart 2> /dev/null || echo "bind9 not installed?"
149 } 152 }
150 153
151 start_sat() { 154 start_sat() {
152 echo "############### Starting sat ##############" 155 echo "############### Starting sat ##############"
153 cd $SAT/src 156 cd $SAT/src
159 } 162 }
160 163
161 start_lib() { 164 start_lib() {
162 echo "############ Starting libervia ############" 165 echo "############ Starting libervia ############"
163 cd $LIBERVIA/src/browser 166 cd $LIBERVIA/src/browser
164 pyjsbuild libervia_main -d --no-compile-inplace --platforms=mozilla -I $TMP -o $LIBERVIA/html 167 #--platforms=mozilla
168 pyjsbuild libervia_main -d --no-compile-inplace -I $TMP -o $LIBERVIA/html
165 cd $LIBERVIA/src 169 cd $LIBERVIA/src
166 if [[ $LIB_DEBUG = 1 ]]; then 170 if [[ $LIB_DEBUG = 1 ]]; then
167 debug_console ./libervia.sh debug 171 debug_console ./libervia.sh debug
168 else 172 else
169 ./libervia.sh 173 ./libervia.sh
197 rm -rf $SHARE/libervia 201 rm -rf $SHARE/libervia
198 } 202 }
199 203
200 sat_main() { 204 sat_main() {
201 echo "######## Starting SàT main instance #######" 205 echo "######## Starting SàT main instance #######"
202 cd $SAT_MAIN/lib/sat && hg pull -u && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./sat.sh 206 cd $SAT_MAIN/lib/sat && hg qpop -a && hg pull -u && hg qpush -a && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./sat.sh
203 echo "#### Starting primitivus main instance ####" 207 echo "#### Starting primitivus main instance ####"
204 cd $SAT_MAIN/lib/sat_frontends/primitivus && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./primitivus -p souliane 208 cd $SAT_MAIN/lib/sat_frontends/primitivus && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./primitivus -p souliane
205 } 209 }
206 210
207 primitivus_main() { 211 primitivus_main() {
257 start_ser) start_ser ;; 261 start_ser) start_ser ;;
258 start_sat) start_sat ;; 262 start_sat) start_sat ;;
259 start_lib) start_lib ;; 263 start_lib) start_lib ;;
260 stop) stop_lib && stop_sat && stop_ser ;; 264 stop) stop_lib && stop_sat && stop_ser ;;
261 start) start_ser && start_sat && start_lib;; 265 start) start_ser && start_sat && start_lib;;
266 restart_sps) stop_sps && start_sps ;;
262 restart_ser) stop_ser && start_ser ;; 267 restart_ser) stop_ser && start_ser ;;
263 restart_sat) stop_sat && start_sat ;; 268 restart_sat) stop_sat && start_sat ;;
264 restart_lib) stop_lib && start_lib ;; 269 restart_lib) stop_lib && start_lib ;;
265 restart_all) 270 restart_all)
266 stop_lib && stop_sat && stop_ser && clean 271 stop_lib && stop_sat && stop_ser && clean