rpms/mysql/devel mysql.init,1.26,1.27 mysql.spec,1.134,1.135

Tom Lane tgl at fedoraproject.org
Thu Dec 17 19:38:27 UTC 2009


Author: tgl

Update of /cvs/pkgs/rpms/mysql/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8476

Modified Files:
	mysql.init mysql.spec 
Log Message:
Stop waiting during "service mysqld start" if mysqld_safe exits


Index: mysql.init
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/mysql.init,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- mysql.init	10 Nov 2009 20:04:18 -0000	1.26
+++ mysql.init	17 Dec 2009 19:38:26 -0000	1.27
@@ -72,29 +72,34 @@ start(){
 	/usr/bin/mysqld_safe   --datadir="$datadir" --socket="$socketfile" \
 		--pid-file="$mypidfile" \
 		--user=mysql >/dev/null 2>&1 &
-	ret=$?
-	# Spin for a maximum of N seconds waiting for the server to come up.
+	safe_pid=$!
+	# Spin for a maximum of N seconds waiting for the server to come up;
+	# exit the loop immediately if mysqld_safe process disappears.
 	# Rather than assuming we know a valid username, accept an "access
 	# denied" response as meaning the server is functioning.
+	ret=0
+	STARTTIMEOUT=120
+	while [ $STARTTIMEOUT -gt 0 ]; do
+	    RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break
+	    echo "$RESPONSE" | grep -q "Access denied for user" && break
+	    if ! /bin/kill -0 $safe_pid 2>/dev/null; then
+		echo "MySQL Daemon failed to start."
+		ret=1
+		break
+	    fi
+	    sleep 1
+	    let STARTTIMEOUT=${STARTTIMEOUT}-1
+	done
+	if [ $STARTTIMEOUT -eq 0 ]; then
+	    echo "Timeout error occurred trying to start MySQL Daemon."
+	    ret=1
+	fi
 	if [ $ret -eq 0 ]; then
-	    STARTTIMEOUT=60
-	    while [ $STARTTIMEOUT -gt 0 ]; do
-		RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break
-		echo "$RESPONSE" | grep -q "Access denied for user" && break
-		sleep 1
-		let STARTTIMEOUT=${STARTTIMEOUT}-1
-	    done
-	    if [ $STARTTIMEOUT -eq 0 ]; then
-                    echo "Timeout error occurred trying to start MySQL Daemon."
-                    action $"Starting $prog: " /bin/false
-                    ret=1
-            else
-                    action $"Starting $prog: " /bin/true
-            fi
+	    action $"Starting $prog: " /bin/true
+	    touch /var/lock/subsys/mysqld
 	else
-    	    action $"Starting $prog: " /bin/false
+	    action $"Starting $prog: " /bin/false
 	fi
-	[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
 	return $ret
 }
 


Index: mysql.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/mysql.spec,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -p -r1.134 -r1.135
--- mysql.spec	24 Nov 2009 05:04:04 -0000	1.134
+++ mysql.spec	17 Dec 2009 19:38:27 -0000	1.135
@@ -1,6 +1,6 @@
 Name: mysql
 Version: 5.1.41
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: MySQL client programs and shared libraries
 Group: Applications/Databases
 URL: http://www.mysql.com
@@ -649,9 +649,15 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Thu Dec 17 2009 Tom Lane <tgl at redhat.com> 5.1.41-2
+- Stop waiting during "service mysqld start" if mysqld_safe exits
+Resolves: #544095
+
 * Mon Nov 23 2009 Tom Lane <tgl at redhat.com> 5.1.41-1
 - Update to MySQL 5.1.41, for various fixes described at
   http://dev.mysql.com/doc/refman/5.1/en/news-5-1-41.html
+  including fixes for CVE-2009-4019
+Related: #540906
 - Don't set old_passwords=1; we aren't being bug-compatible with 3.23 anymore
 Resolves: #540735
 




More information about the fedora-extras-commits mailing list