diff --git a/jobs/run_init.sh b/jobs/run_init.sh index c9930883..27e9f93f 100755 --- a/jobs/run_init.sh +++ b/jobs/run_init.sh @@ -5,8 +5,6 @@ export LANG=zh_CN.UTF-8 export PYTHONPATH=/data/stock export LC_CTYPE=zh_CN.UTF-8 -mkdir -p /data/logs/tensorflow - DATE=`date +%Y-%m-%d:%H:%M:%S` @@ -26,4 +24,4 @@ printenv | grep -v "no_proxy" >> /etc/environment nohup bash /data/stock/jobs/cron.daily/run_daily & #启动cron服务。在前台 -/usr/sbin/cron -f \ No newline at end of file +/usr/sbin/cron -f diff --git a/jobs/run_web.sh b/jobs/run_web.sh index 7fcef82e..bbc01f8a 100755 --- a/jobs/run_web.sh +++ b/jobs/run_web.sh @@ -5,5 +5,5 @@ export LANG=zh_CN.UTF-8 export PYTHONPATH=/data/stock export LC_CTYPE=zh_CN.UTF-8 -echo "" > /data/logs/web.log -/usr/local/bin/python3 /data/stock/web/main.py -log_file_prefix=/data/logs/web.log \ No newline at end of file +echo "start main.py" > /data/logs/web.log +/usr/local/bin/python3 /data/stock/web/main.py -log_file_prefix=/data/logs/web.log >> /data/logs/web.log 2>&1 diff --git a/startStock.sh b/startStock.sh index 97758494..27380d19 100755 --- a/startStock.sh +++ b/startStock.sh @@ -2,7 +2,7 @@ PWD=`pwd` -DB_IS_RUN=`docker ps --filter "name=mariadb" --filter "status=running" | wc -l ` +DB_IS_RUN=`docker ps --filter "name=mysqldb" --filter "status=running" | wc -l ` if [ $DB_IS_RUN -lt 2 ]; then #判断文件夹存在不。 @@ -17,7 +17,6 @@ if [ $DB_IS_RUN -lt 2 ]; then ####################### 启动数据库 ####################### #检查mysqldb是否启动 - DB_IS_RUN=`docker ps --filter "name=mysqldb" --filter "status=running" | wc -l ` if [ $DB_IS_RUN -ne 2 ]; then @@ -34,7 +33,6 @@ if [ $DB_IS_RUN -lt 2 ]; then #检查mysqldb是否启动,等待5秒钟,再次检查mysqldb启动 - DB_IS_RUN=`docker ps --filter "name=mysqldb" --filter "status=running" | wc -l ` if [ $DB_IS_RUN -ne 2 ]; then echo "mysqldb is not running !!!" exit 1; @@ -61,7 +59,7 @@ if [ $# == 1 ] ; then docker run -itd --link=mysqldb --name stock \ -e LANG=zh_CN.UTF-8 -e LC_CTYPE=zh_CN.UTF-8 -e PYTHONIOENCODING=utf-8 \ - -p 8888:8888 -p 9999:9999 --restart=always \ + -p 9999:9999 --restart=always \ -v ${PWD}/jobs:/data/stock/jobs \ -v ${PWD}/libs:/data/stock/libs \ -v ${PWD}/web:/data/stock/web \ @@ -74,7 +72,7 @@ else echo "############# run online ############# " # /data/stock 是代码目录 -v /data/stock:/data/stock 是开发模式。 docker run -itd --link=mysqldb --name stock \ - -p 8888:8888 -p 9999:9999 --restart=always \ + -p 9999:9999 --restart=always \ pythonstock/pythonstock:latest exit 1; fi diff --git a/web/main.py b/web/main.py index d32af45f..86fc84b0 100755 --- a/web/main.py +++ b/web/main.py @@ -87,7 +87,6 @@ def main(): port = 9999 http_server.listen(port) # tornado.options.options.logging = "debug" - tornado.options.parse_command_line() tornado.ioloop.IOLoop.current().start()