Commit 6e5bf987 authored by Mathieu Rodic's avatar Mathieu Rodic

[BUG] using python3.4 for nlpserver

(couldn't get it to work with 3.5)
parent 7e8d0634
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# In case this bash file is placed in another directory (e.g., /etc/init.d), # In case this bash file is placed in another directory (e.g., /etc/init.d),
# the following line should be changed to an absolute path # the following line should be changed to an absolute path
PYTHON_VERSION=3.4
DAEMON_DIR=$( cd "$(dirname "$BASH_SOURCE[0]")" && pwd) DAEMON_DIR=$( cd "$(dirname "$BASH_SOURCE[0]")" && pwd)
DAEMON_SCRIPT=$DAEMON_DIR/server.py DAEMON_SCRIPT=$DAEMON_DIR/server.py
DAEMON_NAME=nlpserver DAEMON_NAME=nlpserver
...@@ -17,7 +18,7 @@ do_start () { ...@@ -17,7 +18,7 @@ do_start () {
log_daemon_msg "Starting system '$DAEMON_NAME' daemon..." log_daemon_msg "Starting system '$DAEMON_NAME' daemon..."
/sbin/start-stop-daemon --start --quiet \ /sbin/start-stop-daemon --start --quiet \
--make-pidfile --pidfile $DAEMON_PID --background \ --make-pidfile --pidfile $DAEMON_PID --background \
--startas /bin/bash -- -c "python3 $DAEMON_SCRIPT $DAEMON_ARGS > /tmp/$DAEMON_NAME.log 2>&1" --startas /bin/bash -- -c "python$PYTHON_VERSION $DAEMON_SCRIPT $DAEMON_ARGS > /tmp/$DAEMON_NAME.log 2>&1"
# --exec $DAEMON_SCRIPT \ # --exec $DAEMON_SCRIPT \
# --user $DAEMON_USER --chuid $DAEMON_USER # --user $DAEMON_USER --chuid $DAEMON_USER
log_end_msg $? log_end_msg $?
...@@ -25,6 +26,7 @@ do_start () { ...@@ -25,6 +26,7 @@ do_start () {
do_stop () { do_stop () {
log_daemon_msg "Stopping system '$DAEMON_NAME' daemon..." log_daemon_msg "Stopping system '$DAEMON_NAME' daemon..."
/sbin/start-stop-daemon --stop --pidfile $DAEMON_PID --retry 10 /sbin/start-stop-daemon --stop --pidfile $DAEMON_PID --retry 10
rm $DAEMON_PID
log_end_msg $? log_end_msg $?
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment