U api update

pull/22/head
vapao 2020-01-08 00:25:18 +08:00
parent 1b617fa146
commit f1f20ec00a
7 changed files with 54 additions and 0 deletions

0
spug_api/logs/.gitkeep Normal file
View File

View File

@ -0,0 +1,5 @@
#!/bin/bash
# start api service
cd $(dirname $(dirname $0))
source ./venv/bin/activate
exec gunicorn -b :9001 -w 2 --threads 8 --access-logfile - spug.wsgi

View File

@ -0,0 +1,5 @@
#!/bin/bash
# start monitor service
cd $(dirname $(dirname $0))
source ./venv/bin/activate
exec python manage.py runmonitor

View File

@ -0,0 +1,5 @@
#!/bin/bash
# start schedule service
cd $(dirname $(dirname $0))
source ./venv/bin/activate
exec python manage.py runscheduler

View File

@ -0,0 +1,5 @@
#!/bin/bash
# start worker service
cd $(dirname $(dirname $0))
source ./venv/bin/activate
exec python manage.py runworker ssh_exec

View File

@ -0,0 +1,5 @@
#!/bin/bash
# start websocket service
cd $(dirname $(dirname $0))
source ./venv/bin/activate
exec daphne -p 9002 spug.asgi:application

View File

@ -0,0 +1,29 @@
[program:spug-api]
command = bash /data/spug/spug_api/tools/start-api.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/api.log
redirect_stderr = true
[program:spug-ws]
command = bash /data/spug/spug_api/tools/start-ws.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/ws.log
redirect_stderr = true
[program:spug-worker]
command = bash /data/spug/spug_api/tools/start-worker.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/worker.log
redirect_stderr = true
[program:spug-monitor]
command = bash /data/spug/spug_api/tools/start-monitor.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/monitor.log
redirect_stderr = true
[program:spug-scheduler]
command = bash /data/spug/spug_api/tools/start-scheduler.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/scheduler.log
redirect_stderr = true