Mercurial > libervia-backend
comparison src/sat.sh @ 2438:a34b4fca16e2
core (sat.sh): force python 2 to launch twistd, and avoid launching wrong version if twistd is installed for python 3 too
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 17 Nov 2017 10:59:59 +0100 |
parents | 7a07f232e7cb |
children |
comparison
equal
deleted
inserted
replaced
2437:91bbad17fd53 | 2438:a34b4fca16e2 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 DEBUG="" | 3 DEBUG="" |
4 DAEMON="" | 4 DAEMON="" |
5 PYTHON="python2" | 5 PYTHON="python2" |
6 TWISTD="$(which twistd)" | |
6 | 7 |
7 kill_process() { | 8 kill_process() { |
8 # $1 is the file containing the PID to kill, $2 is the process name | 9 # $1 is the file containing the PID to kill, $2 is the process name |
9 if [ -f $1 ]; then | 10 if [ -f $1 ]; then |
10 PID=`cat $1` | 11 PID=`cat $1` |
101 log_dir=`dirname "$LOG_FILE"` | 102 log_dir=`dirname "$LOG_FILE"` |
102 if [ ! -d $log_dir ] ; then | 103 if [ ! -d $log_dir ] ; then |
103 mkdir $log_dir | 104 mkdir $log_dir |
104 fi | 105 fi |
105 | 106 |
106 exec twistd $MAIN_OPTIONS $ADDITIONAL_OPTIONS $APP_NAME_FILE | 107 exec $PYTHON $TWISTD $MAIN_OPTIONS $ADDITIONAL_OPTIONS $APP_NAME_FILE |