Mercurial > libervia-backend
comparison src/sat.sh @ 1115:b56374a1f6d6
misc: daemon mode refactoring:
- there is no more daemon mode disctinction between local and installed version
- sat is launched as daemon by default, use "sat fg" to launch it foreground
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Aug 2014 23:45:21 +0200 |
parents | 7293233970ab |
children | 9ae01ccf89c1 |
comparison
equal
deleted
inserted
replaced
1114:7293233970ab | 1115:b56374a1f6d6 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 DEBUG="" | 3 DEBUG="" |
4 DAEMON="" | |
4 PYTHON="python2" | 5 PYTHON="python2" |
5 | 6 |
6 kill_process() { | 7 kill_process() { |
7 # $1 is the file containing the PID to kill, $2 is the process name | 8 # $1 is the file containing the PID to kill, $2 is the process name |
8 if [ -f $1 ]; then | 9 if [ -f $1 ]; then |
57 # if there is one argument which is "stop", then we kill SàT | 58 # if there is one argument which is "stop", then we kill SàT |
58 if [ $# -eq 1 ];then | 59 if [ $# -eq 1 ];then |
59 if [ $1 = "stop" ];then | 60 if [ $1 = "stop" ];then |
60 kill_process $PID_FILE "$APP_NAME" | 61 kill_process $PID_FILE "$APP_NAME" |
61 exit 0 | 62 exit 0 |
62 fi | 63 elif [ $1 = "debug" ];then |
63 if [ $1 = "debug" ];then | |
64 echo "Launching $APP_NAME in debug mode" | 64 echo "Launching $APP_NAME in debug mode" |
65 DEBUG="--debug" | 65 DEBUG="--debug" |
66 elif [ $1 = "fg" ];then | |
67 echo "Launching $APP_NAME in foreground mode" | |
68 DAEMON="n" | |
66 fi | 69 fi |
67 fi | 70 fi |
68 | 71 |
69 DAEMON="n" | |
70 MAIN_OPTIONS="-${DAEMON}oy" | 72 MAIN_OPTIONS="-${DAEMON}oy" |
71 TAP_PATH="./" | 73 TAP_PATH="./" |
72 TAP_FILE="$APP_NAME_FILE.tac" | 74 TAP_FILE="$APP_NAME_FILE.tac" |
73 | 75 |
74 #Don't change the next line | 76 #Don't change the next line |