changeset 983:8c9fdb58de5f

server (libervia.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 11:01:34 +0100
parents a78169c1bf77
children f0fc28b3bd1e
files src/libervia.sh
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/libervia.sh	Wed Nov 15 09:00:00 2017 +0100
+++ b/src/libervia.sh	Fri Nov 17 11:01:34 2017 +0100
@@ -3,6 +3,7 @@
 DEBUG=""
 DAEMON=""
 PYTHON="python2"
+TWISTD="$(which twistd)"
 
 kill_process() {
     # $1 is the file containing the PID to kill, $2 is the process name
@@ -103,4 +104,4 @@
     mkdir $log_dir
 fi
 
-exec twistd $MAIN_OPTIONS $ADDITIONAL_OPTIONS $APP_NAME_FILE $PLUGIN_OPTIONS $@
+exec $PYTHON $TWISTD $MAIN_OPTIONS $ADDITIONAL_OPTIONS $APP_NAME_FILE $PLUGIN_OPTIONS $@