mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
781 B
47 lines
781 B
#!/bin/bash
|
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|
DIR=$(cd "$(dirname "$0")"; pwd)
|
|
MDIR=$(dirname "$DIR")
|
|
|
|
PATH=$PATH:$DIR/bin
|
|
|
|
if [ -f bin/activate ];then
|
|
source bin/activate
|
|
fi
|
|
|
|
mw_start(){
|
|
gunicorn -c setting.py app:app
|
|
python3 task.py &
|
|
}
|
|
|
|
|
|
mw_start_debug(){
|
|
|
|
python3 task.py &
|
|
gunicorn -b :7200 -k gevent -w 1 app:app
|
|
# gunicorn -b :7200 -k eventlet -w 1 app:app
|
|
# gunicorn -c setting.py app:app
|
|
}
|
|
|
|
mw_stop()
|
|
{
|
|
PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'`
|
|
for i in $PLIST
|
|
do
|
|
kill -9 $i
|
|
done
|
|
ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9
|
|
}
|
|
|
|
case "$1" in
|
|
'start') mw_start;;
|
|
'stop') mw_stop;;
|
|
'restart')
|
|
mw_stop
|
|
mw_start
|
|
;;
|
|
'debug')
|
|
mw_stop
|
|
mw_start_debug
|
|
;;
|
|
esac |