From 70af814d472dc4071a09fcc62cc88f3d431ead84 Mon Sep 17 00:00:00 2001 From: liwei Date: Thu, 21 Jul 2022 20:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/start.sh | 6 +++--- bin/stop.sh | 4 ++-- bin/stup.sh | 16 ++++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/bin/start.sh b/bin/start.sh index af39ddb9e..141329c75 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -1,6 +1,6 @@ -./stup.sh start mainte ./conf/mainte.yaml mainte +./stup.sh start mainte mainte ./conf/mainte.yaml sleep 1 -./stup.sh start worker ./conf/worker_1.yaml worker_1 +./stup.sh start worker_1 worker ./conf/worker_1.yaml sleep 1 -./stup.sh start gateway ./conf/gateway_1.yaml gateway_1 +./stup.sh start gateway_1 gateway ./conf/gateway_1.yaml diff --git a/bin/stop.sh b/bin/stop.sh index 574f0e41d..d9cd2d95f 100755 --- a/bin/stop.sh +++ b/bin/stop.sh @@ -1,5 +1,5 @@ -./stup.sh stop gateway +./stup.sh stop gateway_1 ./stup.sh stop mainte -./stup.sh stop worker +./stup.sh stop worker_1 diff --git a/bin/stup.sh b/bin/stup.sh index 0b474b05e..26c221631 100755 --- a/bin/stup.sh +++ b/bin/stup.sh @@ -1,13 +1,15 @@ #!/bin/sh - SERVICE=$4 - CMD="./$2 -conf $3" + SERVICE=$2 + CMD="./$3 -conf $4" start(){ - echo "starting $SERVICE ..." + echo "starting $SERVICE..." + num=`ps -ef | grep $SERVICE | grep -v grep | wc -l` if [ $num -eq 0 ] - then #未启动启动程序 - nohup $CMD > /dev/null 2>&1 & + then + nohup $CMD > /dev/null 2>&1 & + # nohup $CMD >output.log 2>&1 & if [ $? -ne 0 ] then echo "start failed, please check the log!" @@ -16,9 +18,11 @@ echo $! > $SERVICE.pid echo "start success" fi - else #已启动不能重复启动 + else echo "$SERVICE is already running" fi + + } stop(){ echo "stopping..."