Mercurial > libervia-backend
annotate src/sat.sh @ 358:f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 06 Jun 2011 18:34:40 +0200 |
parents | 31804aa9d3da |
children | e83d0c21d64d |
rev | line source |
---|---|
4 | 1 #!/bin/sh |
225
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
2 |
234
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
3 #if there is one argument which is "stop", then we kill SàT |
249
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
4 DEBUG="" |
234
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
5 if [ $# -eq 1 ];then |
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
6 if [ $1 = "stop" ];then |
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
7 echo "Terminating Salut à Toi" |
315 | 8 pkill -f "twistd.*/sat.tac" |
234
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
9 exit 0 |
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
10 fi |
249
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
11 if [ $1 = "debug" ];then |
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
12 echo "Launching SàT in debug mode" |
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
13 DEBUG="--debug" |
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
14 fi |
234
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
15 fi |
a7079e835432
added stop command in sat.sh launching script
Goffi <goffi@goffi.org>
parents:
226
diff
changeset
|
16 |
225
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
17 NAME='sat' |
4 | 18 |
358
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
19 if [ -n "$SAT_CONST_local_dir" ];then |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
20 echo "Using overidded local dir: $SAT_CONST_local_dir" |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
21 PID_FILE="$SAT_CONST_local_dir/$NAME.pid" |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
22 LOG_FILE="$SAT_CONST_local_dir/$NAME.log" |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
23 else |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
24 PID_FILE="/tmp/$NAME.pid" |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
25 LOG_FILE=~/".$NAME/$NAME.log" |
f147b778511a
core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
Goffi <goffi@goffi.org>
parents:
315
diff
changeset
|
26 fi |
225
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
27 DAEMON="n" |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
28 MAIN_OPTIONS="-${DAEMON}oy" |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
29 TAP_PATH="./" |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
30 TAP_FILE="$NAME.tac" |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
31 |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
32 #Don't change the next line |
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
33 AUTO_OPTIONS="" |
249
0ed5553b5313
added "debug" command to sat launcher script
Goffi <goffi@goffi.org>
parents:
234
diff
changeset
|
34 ADDITIONAL_OPTIONS="--pidfile $PID_FILE --logfile $LOG_FILE $AUTO_OPTIONS $DEBUG" |
225
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
35 |
226
d8bb72f00eec
distutils install: fixed plugin import and log file path
Goffi <goffi@goffi.org>
parents:
225
diff
changeset
|
36 log_dir=`dirname "$LOG_FILE"` |
d8bb72f00eec
distutils install: fixed plugin import and log file path
Goffi <goffi@goffi.org>
parents:
225
diff
changeset
|
37 if [ ! -d $log_dir ] ; then |
d8bb72f00eec
distutils install: fixed plugin import and log file path
Goffi <goffi@goffi.org>
parents:
225
diff
changeset
|
38 mkdir $log_dir |
d8bb72f00eec
distutils install: fixed plugin import and log file path
Goffi <goffi@goffi.org>
parents:
225
diff
changeset
|
39 fi |
d8bb72f00eec
distutils install: fixed plugin import and log file path
Goffi <goffi@goffi.org>
parents:
225
diff
changeset
|
40 |
225
fd9b7834d98a
distutils installation script, draft
Goffi <goffi@goffi.org>
parents:
223
diff
changeset
|
41 twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS |