mirror of https://github.com/midoks/mdserver-web
parent
176782954f
commit
7a7b8b4d3b
@ -0,0 +1 @@ |
||||
7200 |
@ -1,5 +0,0 @@ |
||||
#!/bin/bash |
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
||||
|
||||
curPath=`pwd` |
||||
rootPath=$(dirname "$curPath") |
@ -0,0 +1,35 @@ |
||||
#!/bin/bash |
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
||||
|
||||
mw_path={$SERVER_PATH} |
||||
|
||||
mw_start(){ |
||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'` |
||||
if [ "$isStart" == '' ];then |
||||
echo -e "Starting mw... \c" |
||||
cd $mw_path && gunicorn -c setting.py app:app & |
||||
sleep 0.1 |
||||
port=$(cat ${mw_path}/data/port.pl) |
||||
isStart=$(lsof -i :$port|grep LISTEN) |
||||
if [ "$isStart" == '' ];then |
||||
echo -e "\033[31mfailed\033[0m" |
||||
echo '------------------------------------------------------' |
||||
tail -n 20 $panel_path/logs/error.log |
||||
echo '------------------------------------------------------' |
||||
echo -e "\033[31mError: mw service startup failed.\033[0m" |
||||
return; |
||||
fi |
||||
echo -e "\033[32mdone\033[0m" |
||||
else |
||||
echo "Starting mw... mw(pid $(echo $isStart)) already running" |
||||
fi |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
case "$1" in |
||||
'start') |
||||
mw_start |
||||
;; |
||||
esac |
@ -0,0 +1,27 @@ |
||||
import os |
||||
import time |
||||
import sys |
||||
sys.path.append(os.getcwd() + '/class/core') |
||||
import public |
||||
|
||||
|
||||
bt_port = public.readFile('data/port.pl') |
||||
bind = ['0.0.0.0:%s' % bt_port] |
||||
workers = 1 |
||||
threads = 1 |
||||
backlog = 512 |
||||
reload = False |
||||
daemon = False |
||||
timeout = 7200 |
||||
keepalive = 1 |
||||
# worker_class = 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker' |
||||
chdir = os.getcwd() |
||||
# capture_output = True |
||||
# access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"' |
||||
# loglevel = 'info' |
||||
# errorlog = chdir + '/logs/error.log' |
||||
# accesslog = chdir + '/logs/access.log' |
||||
# pidfile = chdir + '/logs/panel.pid' |
||||
# if os.path.exists(chdir + '/data/ssl.pl'): |
||||
# certfile = 'ssl/certificate.pem' |
||||
# keyfile = 'ssl/privateKey.pem' |
@ -1,7 +1,4 @@ |
||||
#!/bin/sh |
||||
|
||||
gunicorn -b :7200 app:app & |
||||
|
||||
gunicorn -c setting.py app:app & |
||||
python task.py & |
||||
|
||||
#open "http://127.0.0.1:7200" |
Loading…
Reference in new issue