From d4b1bdef8e2859b638cd0f5c5c20e12ef9957973 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 23 Feb 2016 18:46:00 +0800 Subject: [PATCH] =?UTF-8?q?modify(with=200e9a962506)=20=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 启动时添加 django crontab 2. 关闭时删除 django crontab --- service.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service.sh b/service.sh index b2d9b34ae..3eca1bf05 100755 --- a/service.sh +++ b/service.sh @@ -26,6 +26,7 @@ start() { success "$jump_start" else daemon python $base_dir/manage.py runserver 0.0.0.0:80 &>> /tmp/jumpserver.log 2>&1 & + daemon python $base_dir/manage.py crontab add &>> /tmp/jumpserver.log 2>&1 daemon python $base_dir/run_websocket.py &> /dev/null 2>&1 & sleep 4 @@ -53,6 +54,7 @@ stop() { echo -n $"Stopping ${PROC_NAME} service:" + daemon python $base_dir/manage.py crontab remove &>> /tmp/jumpserver.log 2>&1 ps aux | grep -E 'manage.py|run_websocket.py' | grep -v grep | awk '{print $2}' | xargs kill -9 &> /dev/null ret=$?