上传
This commit is contained in:
parent
477bfd265a
commit
fe39bf30c1
0
bin/start.sh
Normal file → Executable file
0
bin/start.sh
Normal file → Executable file
0
bin/stop.sh
Normal file → Executable file
0
bin/stop.sh
Normal file → Executable file
17
bin/stup.sh
17
bin/stup.sh
@ -1,10 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
SERVICE=$2
|
SERVICE=$2
|
||||||
CMD="./$2 -conf $3"
|
CMD="./$3 -conf $4"
|
||||||
|
|
||||||
start(){
|
start(){
|
||||||
echo "starting..."
|
echo "starting $SERVICE..."
|
||||||
nohup $CMD > /dev/null 2>&1 &
|
|
||||||
|
num=`ps -ef | grep $SERVICE | grep -v grep | wc -l`
|
||||||
|
if [ $num -eq 0 ]
|
||||||
|
then
|
||||||
|
nohup $CMD > /dev/null 2>&1 &
|
||||||
# nohup $CMD >output.log 2>&1 &
|
# nohup $CMD >output.log 2>&1 &
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
@ -14,9 +18,14 @@
|
|||||||
echo $! > $SERVICE.pid
|
echo $! > $SERVICE.pid
|
||||||
echo "start success"
|
echo "start success"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "$SERVICE is already running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
stop(){
|
stop(){
|
||||||
echo "stopping..."
|
echo "stopping $SERVICE..."
|
||||||
kill -9 `cat $SERVICE.pid`
|
kill -9 `cat $SERVICE.pid`
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user