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..."