Merge pull request #29372 from freemine/freemine.test.script.bug.fix
fix ps/grep/kill flaws found in test.script
This commit is contained in:
commit
3095542c64
|
@ -7,13 +7,21 @@ unset LD_PRELOAD
|
|||
UNAME_BIN=`which uname`
|
||||
OS_TYPE=`$UNAME_BIN`
|
||||
|
||||
psby() {
|
||||
if [ "$OS_TYPE" != "Darwin" ]; then
|
||||
ps -C $1
|
||||
else
|
||||
ps a -c
|
||||
fi
|
||||
}
|
||||
|
||||
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$PID" ]; then
|
||||
echo systemctl stop taosd
|
||||
systemctl stop taosd
|
||||
fi
|
||||
|
||||
PID=`ps -ef|grep -w taosd | grep -v grep | grep -v taosanode | awk '{print $2}'`
|
||||
PID=`psby taosd | grep -w "[t]aosd" | awk '{print $1}' | head -n 1`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -9 $PID
|
||||
#pkill -9 taosd
|
||||
|
@ -24,10 +32,10 @@ while [ -n "$PID" ]; do
|
|||
else
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
||||
PID=`psby taosd | grep -w "[t]aosd" | awk '{print $1}' | head -n 1`
|
||||
done
|
||||
|
||||
PID=`ps -ef|grep -w taos | grep -v grep | grep -v taosanode|awk '{print $2}'`
|
||||
PID=`psby taos | grep -w "[t]aos" | awk '{print $1}' | head -n 1`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -9 $PID
|
||||
#pkill -9 taos
|
||||
|
@ -38,10 +46,10 @@ while [ -n "$PID" ]; do
|
|||
else
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w taos | grep -v grep |grep -v taosanode| awk '{print $2}'`
|
||||
PID=`psby taos | grep -w "[t]aos" | awk '{print $1}' | head -n 1`
|
||||
done
|
||||
|
||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | grep -v taosanode|awk '{print $2}'`
|
||||
PID=`psby tmq_sim | grep -w "[t]mq_sim" | awk '{print $1}' | head -n 1`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -9 $PID
|
||||
#pkill -9 tmq_sim
|
||||
|
@ -52,5 +60,5 @@ while [ -n "$PID" ]; do
|
|||
else
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | grep -v taosanode| awk '{print $2}'`
|
||||
PID=`psby tmq_sim | grep -w "[t]mq_sim" | awk '{print $1}' | head -n 1`
|
||||
done
|
|
@ -43,9 +43,9 @@ CODE_DIR=`pwd`
|
|||
|
||||
IN_TDINTERNAL="community"
|
||||
if [[ "$CODE_DIR" == *"$IN_TDINTERNAL"* ]]; then
|
||||
cd ../../..
|
||||
pushd ../../..
|
||||
else
|
||||
cd ../../
|
||||
pushd ../../
|
||||
fi
|
||||
|
||||
TOP_DIR=`pwd`
|
||||
|
@ -119,6 +119,8 @@ ulimit -c unlimited
|
|||
|
||||
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
|
||||
|
||||
popd
|
||||
|
||||
if [ -n "$FILE_NAME" ]; then
|
||||
echo "------------------------------------------------------------------------"
|
||||
if [ $VALGRIND -eq 1 ]; then
|
||||
|
|
Loading…
Reference in New Issue