diff --git a/mysql.init b/mysql.init index b0ee125..7504156 100644 --- a/mysql.init +++ b/mysql.init @@ -76,7 +76,7 @@ start(){ # Rather than assuming we know a valid username, accept an "access # denied" response as meaning the server is functioning. if [ $ret -eq 0 ]; then - STARTTIMEOUT=10 + STARTTIMEOUT=30 while [ $STARTTIMEOUT -gt 0 ]; do RESPONSE=`/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping 2>&1` && break echo "$RESPONSE" | grep -q "Access denied for user" && break @@ -97,17 +97,34 @@ start(){ } stop(){ - /bin/kill `cat "$mypidfile" 2>/dev/null ` >/dev/null 2>&1 - ret=$? - if [ $ret -eq 0 ]; then - sleep 2 - rm -f /var/lock/subsys/mysqld - rm -f "$socketfile" - action $"Stopping $prog: " /bin/true - else - action $"Stopping $prog: " /bin/false - fi - return $ret + MYSQLPID=`cat "$mypidfile" 2>/dev/null ` + if [ -n "$MYSQLPID" ]; then + /bin/kill "$MYSQLPID" >/dev/null 2>&1 + ret=$? + if [ $ret -eq 0 ]; then + STOPTIMEOUT=60 + while [ $STOPTIMEOUT -gt 0 ]; do + /bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break + sleep 1 + let STOPTIMEOUT=${STOPTIMEOUT}-1 + done + if [ $STOPTIMEOUT -eq 0 ]; then + echo "Timeout error occurred trying to stop MySQL Daemon." + ret=1 + action $"Stopping $prog: " /bin/false + else + rm -f /var/lock/subsys/mysqld + rm -f "$socketfile" + action $"Stopping $prog: " /bin/true + fi + else + action $"Stopping $prog: " /bin/false + fi + else + ret=1 + action $"Stopping $prog: " /bin/false + fi + return $ret } restart(){ diff --git a/mysql.spec b/mysql.spec index dd89a4e..0afdc7d 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,6 +1,6 @@ Name: mysql Version: 5.0.15 -Release: 2 +Release: 3 Source0: http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-%{version}.tar.gz Source1: mysql.init Source2: mysql.logrotate @@ -355,6 +355,9 @@ fi %{_datadir}/sql-bench %changelog +* Mon Nov 14 2005 Tom Lane 5.0.15-3 +- Make stop script wait for daemon process to disappear (bz#172426) + * Wed Nov 9 2005 Tom Lane 5.0.15-2 - Rebuild due to openssl library update.