diff options
author | unknown <petr@mysql.com> | 2005-03-31 14:25:03 +0400 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-03-31 14:25:03 +0400 |
commit | dbbe069019f25bb93de43f3d966c642c1af82e2f (patch) | |
tree | 8f4c434d5404f13bb521e9eeb6b337a67b84def8 /support-files/mysql.server.sh | |
parent | f485db429a26666a8468c1ec1227d6bd64a45682 (diff) | |
download | mariadb-git-dbbe069019f25bb93de43f3d966c642c1af82e2f.tar.gz |
Bug #9507 /etc/init.d/mysql script does not stop mysqld correctly
wait_for_pid function is fixed to wait for pid removal in "stop".
recomitted with post-review fix
support-files/mysql.server.sh:
wait_for_pid function corrected to work properly with start/stop
Diffstat (limited to 'support-files/mysql.server.sh')
-rw-r--r-- | support-files/mysql.server.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index aafd3f8f187..376d9051b10 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -90,7 +90,18 @@ wait_for_pid () { i=0 while test $i -lt 35 ; do sleep 1 - test -s $pid_file && i='' && break + case "$1" in + 'created') + test -s $pid_file && i='' && break + ;; + 'removed') + test ! -s $pid_file && i='' && break + ;; + *) + echo "wait_for_pid () usage: wait_for_pid created|removed" + exit 1 + ;; + esac echo $echo_n ".$echo_c" i=`expr $i + 1` done @@ -180,7 +191,7 @@ case "$mode" in # be overwritten at next upgrade. echo $echo_n "Starting MySQL" $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 & - wait_for_pid + wait_for_pid created # Make lock for RedHat / SuSE if test -w /var/lock/subsys @@ -201,7 +212,7 @@ case "$mode" in echo $echo_n "Shutting down MySQL" kill $mysqld_pid # mysqld should remove the pid_file when it exits, so wait for it. - wait_for_pid + wait_for_pid removed # delete lock for RedHat / SuSE if test -f /var/lock/subsys/mysql |