From 4307f252ea6d4b5ab650cb3f33bbd47a3542ed57 Mon Sep 17 00:00:00 2001 From: vapao Date: Thu, 25 Jun 2020 19:08:17 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E6=9B=B4=E6=96=B0start=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/tools/start-monitor.sh | 9 ++++++++- spug_api/tools/start-scheduler.sh | 9 ++++++++- spug_api/tools/start-worker.sh | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/spug_api/tools/start-monitor.sh b/spug_api/tools/start-monitor.sh index 7f71b5a..6bf2e39 100644 --- a/spug_api/tools/start-monitor.sh +++ b/spug_api/tools/start-monitor.sh @@ -8,4 +8,11 @@ cd $(dirname $(dirname $0)) if [ -f ./venv/bin/activate ]; then source ./venv/bin/activate fi -exec python manage.py runmonitor + +if command -v python3 &> /dev/null; then + PYTHON=python3 +else + PYTHON=python +fi + +exec $PYTHON manage.py runmonitor diff --git a/spug_api/tools/start-scheduler.sh b/spug_api/tools/start-scheduler.sh index 8115c6d..87037fd 100644 --- a/spug_api/tools/start-scheduler.sh +++ b/spug_api/tools/start-scheduler.sh @@ -8,4 +8,11 @@ cd $(dirname $(dirname $0)) if [ -f ./venv/bin/activate ]; then source ./venv/bin/activate fi -exec python manage.py runscheduler + +if command -v python3 &> /dev/null; then + PYTHON=python3 +else + PYTHON=python +fi + +exec $PYTHON manage.py runscheduler diff --git a/spug_api/tools/start-worker.sh b/spug_api/tools/start-worker.sh index a19e826..183372e 100644 --- a/spug_api/tools/start-worker.sh +++ b/spug_api/tools/start-worker.sh @@ -8,4 +8,11 @@ cd $(dirname $(dirname $0)) if [ -f ./venv/bin/activate ]; then source ./venv/bin/activate fi -exec python manage.py runworker ssh_exec + +if command -v python3 &> /dev/null; then + PYTHON=python3 +else + PYTHON=python +fi + +exec $PYTHON manage.py runworker ssh_exec