mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
better fix for bug#5001
This commit is contained in:
parent
001dfd3d48
commit
707def6fd0
1 changed files with 15 additions and 24 deletions
|
@ -322,36 +322,26 @@ do
|
||||||
# but should work for the rest of the servers.
|
# but should work for the rest of the servers.
|
||||||
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
|
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
|
||||||
# kill -9 is used or the process won't react on the kill.
|
# kill -9 is used or the process won't react on the kill.
|
||||||
if test -n "$mysql_tcp_port"
|
numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"`
|
||||||
then
|
|
||||||
numofproces=`ps xa | grep -v "grep" | grep $ledir/$MYSQLD| grep -c "port=$mysql_tcp_port"`
|
|
||||||
else
|
|
||||||
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD`
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
|
echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
|
||||||
I=1
|
I=1
|
||||||
while test "$I" -le "$numofproces"
|
while test "$I" -le "$numofproces"
|
||||||
do
|
do
|
||||||
if test -n "$mysql_tcp_port"
|
PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'`
|
||||||
then
|
|
||||||
PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "port=$mysql_tcp_port" | sed -n '$p'`
|
|
||||||
else
|
|
||||||
PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | sed -n '$p'`
|
|
||||||
fi
|
|
||||||
|
|
||||||
for T in $PROC
|
for T in $PROC
|
||||||
do
|
do
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
# echo "TEST $I - $T **"
|
# echo "TEST $I - $T **"
|
||||||
if kill -9 $T
|
if kill -9 $T
|
||||||
then
|
then
|
||||||
echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
|
echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
I=`expr $I + 1`
|
I=`expr $I + 1`
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log
|
echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log
|
||||||
|
@ -359,3 +349,4 @@ done
|
||||||
|
|
||||||
echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log
|
echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log
|
||||||
echo "" | tee -a $err_log
|
echo "" | tee -a $err_log
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue