上传启动脚本

This commit is contained in:
liwei 2022-07-21 20:59:58 +08:00
parent dd81d65012
commit 70af814d47
3 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -1,13 +1,15 @@
#!/bin/sh
SERVICE=$4
CMD="./$2 -conf $3"
SERVICE=$2
CMD="./$3 -conf $4"
start(){
echo "starting $SERVICE..."
num=`ps -ef | grep $SERVICE | grep -v grep | wc -l`
if [ $num -eq 0 ]
then #未启动启动程序
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..."