Mercurial > sat_docs
annotate scripts/launcher/launch.sh @ 176:e7df6534e387 default tip
association: ajout du compte rendu de l'AG extraordinaire du 17 décembre 2022
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 17 Jan 2023 14:13:58 +0100 |
parents | 4cd5475623eb |
children |
rev | line source |
---|---|
50 | 1 #!/bin/bash |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 # This is a helping script to do some tasks like installing, cleaning, starting sat and/or libervia. |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 |
49 | 5 # Python and resources paths |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
6 PACKAGES=/usr/local/lib/python2.7/dist-packages |
49 | 7 SHARE=/usr/local/share |
8 TMP=~/workspace/tmp_packages | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 # Paths to the projects |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 WORKSPACE=~/workspace |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 SAT=$WORKSPACE/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 PYJS=$WORKSPACE/pyjamas |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 LIBERVIA=$WORKSPACE/libervia |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
15 PROSODY=$WORKSPACE/prosody-hg |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
16 SATPUBSUB=$WORKSPACE/sat_pubsub |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
17 SALUT=$WORKSPACE/salut |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
18 URWID_SATEXT=$WORKSPACE/urwid_satext |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
19 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
20 # PIDs of the processes |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
21 LOCAL_DIR=~/.local/share/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 SAT_PID=$LOCAL_DIR/sat.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 LIB_PID=$LOCAL_DIR/libervia.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
24 SER_PID=$PROSODY/prosody.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 SPS_PID=$SATPUBSUB/twistd.pid |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
26 SALUT_PID=$SALUT/twistd.pid |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
27 |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
28 # Services host |
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
29 SERVICE=libervia |
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
30 |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
31 # Connection information for Prosody components |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
32 SPS_JID=sat-pubsub.$SERVICE |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
33 SPS_PWD=password |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
34 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
35 # Informations for a concurrent sat instance |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
36 # For this to work, you have to follow the instructions in: |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
37 # http://wiki.goffi.org/wiki/Howto_launch_several_S%C3%A0T_instances |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
38 # Also: |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
39 # - modify const_INT_PREFIX in the two DBus.py files |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
40 # - set DAEMON="" in the sat.sh to launch sat as a daemon |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
41 SAT_MAIN=$WORKSPACE/sat_main |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
42 SAT_MAIN_PID=~/.sat_main/sat.pid |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
43 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
44 # 4 Firefox profiles names for testing |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
45 FF_PROFILES=(test1 test2 test3 test4) |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
46 # 4 SàT profiles names for testing |
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
47 SAT_PROFILES=(pierre elisee louise buenaventura) |
40
1eb3ec190ea1
add test_accounts to create a batch of testing profiles
souliane <souliane@mailoo.org>
parents:
18
diff
changeset
|
48 # Common profile password for these profiles |
49 | 49 SAT_PROFILES_PASSWD=xxxxxx |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
50 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
51 # Launch sat in debug mode? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
52 SAT_DEBUG=1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
53 # Launch sat pubsub in debug mode? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
54 SPS_DEBUG=0 |
49 | 55 # Launch salut in debug mode? |
56 SALUT_DEBUG=0 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
57 # Launch libervia in debug mode? |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
58 LIB_DEBUG=0 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
59 # Force killing processes? |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
60 KILL_FORCE=1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
61 |
49 | 62 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
63 kill_process() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
64 # $1 is the file containing the PID to kill |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
65 if [ -f $1 ]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
66 PID=`cat $1` |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
67 if ps -p $PID > /dev/null; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
68 if [[ $KILL_FORCE = 1 ]]; then |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
69 kill -9 $PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
70 else |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
71 kill -INT $PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
72 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
73 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
74 rm -f $1 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
75 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
76 } |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
77 |
49 | 78 debug_console() { |
79 PYTHONPATH=$TMP:$PYTHONPATH x-terminal-emulator -e "$@" & | |
80 } | |
81 | |
82 install() { | |
83 echo "########## Compiling prosody ##########" | |
84 cd $PROSODY && make | |
85 echo "########## Installing sat_pubsub ##########" | |
86 cd $SATPUBSUB && sudo python setup.py install | |
87 echo "############## Installing sat #############" | |
88 cd $SAT && sudo python setup.py install | |
89 echo "########### Installing libervia ###########" | |
90 cd $LIBERVIA && sudo python setup.py install | |
91 } | |
92 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
93 stop_lib() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
94 echo "############ Stopping libervia ############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
95 libervia stop |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
96 kill_process $LIB_PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
97 } |
49 | 98 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
99 stop_sat() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
100 echo "############### Stopping sat ##############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
101 sat stop |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
102 kill_process $SAT_PID |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
103 } |
49 | 104 |
105 stop_sps() { | |
106 kill_process $SPS_PID | |
107 } | |
108 | |
109 stop_salut() { | |
110 kill_process $SALUT_PID | |
111 } | |
112 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
113 stop_ser() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
114 echo "############# Stopping Prosody ############" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
115 cd $PROSODY && if [[ -f $SER_PID ]]; then ./prosodyctl stop; fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
116 kill_process $SER_PID |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
117 echo "####### Stopping Prosody components #######" |
49 | 118 stop_sps |
119 stop_salut | |
120 echo "####### Stopping bind9 #######" | |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
121 sudo /etc/init.d/bind9 stop 2> /dev/null || echo "bind9 not installed?" |
49 | 122 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
123 } |
49 | 124 |
125 start_sps() { | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
126 echo "########### Starting sat-pubsub ###########" |
49 | 127 cd $SATPUBSUB |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
128 if [[ $SPS_DEBUG = 1 ]]; then |
49 | 129 debug_console twistd -n -b sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
130 else |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
131 twistd sat_pubsub --jid=$SPS_JID --secret=$SPS_PWD #-v |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
132 fi |
49 | 133 } |
134 | |
135 start_salut() { | |
7
b01ee1b28680
launching script handles "salut" component
souliane <souliane@mailoo.org>
parents:
6
diff
changeset
|
136 echo "############## Starting salut #############" |
49 | 137 cd $SALUT |
138 if [[ $SALUT_DEBUG = 1 ]]; then | |
139 debug_console twistd -b -y salut.tac | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
140 else |
49 | 141 twistd -y salut.tac |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
142 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
143 } |
49 | 144 |
145 start_ser() { | |
146 echo "############# Starting Prosody ############" | |
147 cd $PROSODY && ./prosodyctl start & | |
148 start_sps | |
149 start_salut | |
150 echo "############## Starting bind9 #############" | |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
151 sudo /etc/init.d/bind9 restart 2> /dev/null || echo "bind9 not installed?" |
49 | 152 } |
153 | |
154 start_sat() { | |
155 echo "############### Starting sat ##############" | |
156 cd $SAT/src | |
157 if [[ $SAT_DEBUG = 1 ]]; then | |
158 debug_console ./sat.sh debug | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
159 else |
49 | 160 ./sat.sh |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
161 fi |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
162 } |
49 | 163 |
164 start_lib() { | |
165 echo "############ Starting libervia ############" | |
166 cd $LIBERVIA/src/browser | |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
167 #--platforms=mozilla |
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
168 pyjsbuild libervia_main -d --no-compile-inplace -I $TMP -o $LIBERVIA/html |
49 | 169 cd $LIBERVIA/src |
170 if [[ $LIB_DEBUG = 1 ]]; then | |
171 debug_console ./libervia.sh debug | |
172 else | |
173 ./libervia.sh | |
174 fi | |
175 } | |
176 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
177 4foxes() { |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
178 # Starts 4 instances of firefox and connect SàT profiles with Libervia |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
179 # Assumes the HTTPS port for local server is 8443 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
180 echo "####### Starting 4 libervia clients #######" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
181 for I in `seq 0 3`; do |
40
1eb3ec190ea1
add test_accounts to create a batch of testing profiles
souliane <souliane@mailoo.org>
parents:
18
diff
changeset
|
182 URL="https://localhost:8443/libervia.html?login=${SAT_PROFILES[$I]}&passwd=${SAT_PROFILES_PASSWD}" |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
183 firefox -no-remote -P ${FF_PROFILES[$I]} "$URL" & |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
184 done |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
185 } |
49 | 186 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
187 clean() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
188 echo "############ Cleaning log files ###########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
189 rm -f $LOCAL_DIR/*.log* |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
190 rm -f $SATPUBSUB/twistd.log* |
49 | 191 rm -f $SALUT/twistd.log* |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
192 rm -f $PROSODY/prosody.log* $PROSODY/prosody.err* |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
193 } |
49 | 194 |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
195 purge() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
196 echo "######## Purging installed packages #######" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
197 rm -rf $PACKAGES/sat |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
198 rm -rf $PACKAGES/sat_frontends |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
199 rm -rf $PACKAGES/libervia |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
200 rm -rf $PACKAGES/libervia_server |
49 | 201 rm -rf $SHARE/libervia |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
202 } |
49 | 203 |
204 sat_main() { | |
6
19448ad3a7d9
add big picture schema + fix launching script
souliane <souliane@mailoo.org>
parents:
3
diff
changeset
|
205 echo "######## Starting SàT main instance #######" |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
206 cd $SAT_MAIN/lib/sat && hg qpop -a && hg pull -u && hg qpush -a && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./sat.sh |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
207 echo "#### Starting primitivus main instance ####" |
49 | 208 cd $SAT_MAIN/lib/sat_frontends/primitivus && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./primitivus -p souliane |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
209 } |
49 | 210 |
211 primitivus_main() { | |
212 echo "#### Starting primitivus main instance ####" | |
213 cd $SAT_MAIN/lib/sat_frontends/primitivus && PYTHONPATH=$SAT_MAIN/lib:$PYTHONPATH ./primitivus | |
214 } | |
215 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
216 bridge() { |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
217 echo "######### Generating DBus.py files ########" |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
218 cd $SAT/src/bridge/bridge_constructor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
219 ./bridge_constructor.py --force && cp generated/DBus.py ../DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
220 ./bridge_constructor.py -s frontend --force && cp generated/DBus.py ../../../frontends/src/bridge/DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
221 cd $SAT_MAIN/src/bridge/bridge_constructor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
222 SAT_BRIDGE_CONST_INT_PREFIX='"org.goffi.sat_main"' ./bridge_constructor.py --force && cp generated/DBus.py ../DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
223 SAT_BRIDGE_CONST_INT_PREFIX='"org.goffi.sat_main"' ./bridge_constructor.py -s frontend --force && cp generated/DBus.py ../../../frontends/src/bridge/DBus.py |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
224 } |
49 | 225 |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
226 monitor_core() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
227 echo "## Monitoring DBus for SàT dev instance - core ##" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
228 dbus-monitor "sender='org.goffi.SAT', interface='org.goffi.SAT.core'" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
229 } |
49 | 230 |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
231 monitor_plugin() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
232 echo "## Monitoring DBus for SàT dev instance - plugin ##" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
233 dbus-monitor "sender='org.goffi.SAT', interface='org.goffi.SAT.plugin'" |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
234 } |
49 | 235 |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
236 monitor_main() { |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
237 echo "## Monitoring DBus for SàT main instance (redirected to /tmp/...) ##" |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
238 killall -q dbus-monitor |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
239 nohup dbus-monitor "sender='org.goffi.sat_main', interface='org.goffi.sat_main.core'" >> /tmp/sat_xml_core_`date +%y.%m.%d`& |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
240 nohup dbus-monitor "sender='org.goffi.sat_main', interface='org.goffi.sat_main.plugin'" >> /tmp/sat_xml_plugin_`date +%y.%m.%d`& |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
241 } |
49 | 242 |
243 link_pkgs() { | |
244 echo "## Linking temporary packages directory ##" | |
245 rm -f $TMP/* # avoid to create symlinks like $TMP/sat/src | |
246 mkdir -p $TMP | |
247 ln -s $SAT/src $TMP/sat | |
248 ln -s $SAT/frontends/src $TMP/sat_frontends | |
249 ln -s $LIBERVIA/src $TMP/libervia | |
250 ln -s $WORKSPACE/urwid_satext/urwid_satext $TMP/urwid_satext | |
251 } | |
252 | |
253 echo "using temporary directory $TMP" | |
254 export PYTHONPATH=$TMP:$PYTHONPATH | |
255 | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
256 case "$1" in |
49 | 257 install) install ;; |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
258 stop_lib) stop_lib ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
259 stop_sat) stop_sat ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
260 stop_ser) stop_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
261 start_ser) start_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
262 start_sat) start_sat ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
263 start_lib) start_lib ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
264 stop) stop_lib && stop_sat && stop_ser ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
265 start) start_ser && start_sat && start_lib;; |
122
4cd5475623eb
scripts (launcher, test_accounts): update
souliane <souliane@mailoo.org>
parents:
50
diff
changeset
|
266 restart_sps) stop_sps && start_sps ;; |
49 | 267 restart_ser) stop_ser && start_ser ;; |
268 restart_sat) stop_sat && start_sat ;; | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
269 restart_lib) stop_lib && start_lib ;; |
49 | 270 restart_all) |
271 stop_lib && stop_sat && stop_ser && clean | |
272 start_ser && start_sat && start_lib;; | |
273 restart_sps) stop_sps && start_sps;; | |
274 restart_salut) stop_salut && start_salut ;; | |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
275 4foxes) 4foxes ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
276 clean) clean ;; |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
277 purge) clean && purge;; |
49 | 278 main) sat_main ;; |
279 primitivus_main) primitivus_main ;; | |
18
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
280 bridge) bridge ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
281 monitor_core) monitor_core ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
282 monitor_plugin) monitor_plugin ;; |
7b337be4052d
updated launcher helping script
souliane <souliane@mailoo.org>
parents:
7
diff
changeset
|
283 monitor_main) monitor_main ;; |
49 | 284 link_pkgs) link_pkgs ;; |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
285 *) |
49 | 286 echo "Please specify a valid command." |
2
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
287 esac |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
288 |
3ec5808e3b53
added screenshots + launching script
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
289 echo "Done." |