summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-09-07 13:48:38 +0200
committerunknown <serg@serg.mylan>2004-09-07 13:48:38 +0200
commit6b1444d7ba70a286f3fc543ab5bc8927106f5638 (patch)
tree0413716971fbc3fba1128c44d2e99debe7425869 /scripts
parente205392de7a201c2d912116f01067b3047f91811 (diff)
downloadmariadb-git-6b1444d7ba70a286f3fc543ab5bc8927106f5638.tar.gz
better fix for bug#5001
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_safe.sh37
1 files changed, 14 insertions, 23 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 8ad2ee1df4d..b9e7ce21f79 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -322,36 +322,26 @@ do
# but should work for the rest of the servers.
# 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.
- if test -n "$mysql_tcp_port"
- 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
+ numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"`
echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
- if test -n "$mysql_tcp_port"
+ PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'`
+
+ for T in $PROC
+ do
+ break
+ done
+ # echo "TEST $I - $T **"
+ if kill -9 $T
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'`
+ echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
+ else
+ break
fi
-
- for T in $PROC
- do
- break
- done
- # echo "TEST $I - $T **"
- if kill -9 $T
- then
- echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
- else
- break
- fi
- I=`expr $I + 1`
+ I=`expr $I + 1`
done
fi
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 "" | tee -a $err_log
+