23.dubbo脚本之stop.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了23.dubbo脚本之stop.sh相关的知识,希望对你有一定的参考价值。
#!/bin/bash
cd `dirname $0`
BIN_DIR=`pwd`
cd ..
DEPLOY_DIR=`pwd`
CONF_DIR=$DEPLOY_DIR/conf
SERVER_NAME=`sed ‘/dubbo.application.name/!d;s/.*=//‘ conf/dubbo.properties | tr -d ‘\r‘`
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME=`hostname`
fi
PIDS=`ps -f | grep java | grep "$CONF_DIR" |awk ‘{print $2}‘`
if [ -z "$PIDS" ]; then
echo "ERROR: The $SERVER_NAME does not started!"
exit 1
fi
if [ "$1" != "skip" ]; then
$BIN_DIR/dump.sh
fi
echo -e "Stopping the $SERVER_NAME ...\c"
for PID in $PIDS ; do
kill $PID > /dev/null 2>&1
done
COUNT=0
while [ $COUNT -lt 1 ]; do
echo -e ".\c"
sleep 1
COUNT=1
for PID in $PIDS ; do
PID_EXIST=`ps -f -p $PID | grep java`
if [ -n "$PID_EXIST" ]; then
COUNT=0
break
fi
done
done
echo "OK!"
echo "PID: $PIDS"
本文出自 “8159085” 博客,请务必保留此出处http://8169085.blog.51cto.com/8159085/1794999
以上是关于23.dubbo脚本之stop.sh的主要内容,如果未能解决你的问题,请参考以下文章
当 Kafka 从 Python 脚本启动时,kafka-server-stop.sh 不起作用
Hadoop编写一键集群全起start-cluster.sh全关stop-cluster.sh显示所有jps进程show-jps.sh脚本 以及解决方案