Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-31 15:39:41-05:00, cmiller@stripped +2 -0
Bug#25341: "init.d/mysql stop" may timeout too quickly
Thirty five seconds is entirely too short of a period to wait for a server
to exit. Instead, make a valliant effort to make sure it exits, and only
give up after a very long period (arbitrarily chosen as 15 minutes).
In addition, if we're being asked to restart the server, then don't try
to start again if trying to stop the server failed.
---
Return zero by default, when the script exits.
---
Set return-/exit-value based on whether we successfully dealt with the
PID-file.
---
Don't wait that long if the program we're waiting on exits. It
should only exit if the server is not going to be started.
BitKeeper/etc/collapsed@stripped, 2007-01-31 15:37:55-05:00, cmiller@stripped +6 -0
support-files/mysql.server.sh@stripped, 2007-01-31 15:39:39-05:00, cmiller@stripped +18 -6
Raise timeout to a pessimistic value, 15 minutes. We should only be willing
to give up and exit after an extraordinary effort.
---
Return zero by default, when the script exits.
---
Set return-/exit-value based on whether we successfully dealt with the
PID-file.
---
Don't wait that long if the program we're waiting on exits. It
should only exit if the server is not going to be started.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cmiller
# Host: zippy.cornsilk.net
# Root: /home/cmiller/work/mysql/bug25341/my50-bug25341
--- 1.52/support-files/mysql.server.sh 2007-01-31 15:39:45 -05:00
+++ 1.53/support-files/mysql.server.sh 2007-01-31 15:39:45 -05:00
@@ -143,11 +143,12 @@ parse_manager_arguments() {
wait_for_pid () {
i=0
- while test $i -lt 35 ; do
+ while test $i -lt 900 ; do
sleep 1
case "$1" in
'created')
test -s $pid_file && i='' && break
+ kill -0 $2 || break # if the program goes away, stop waiting
;;
'removed')
test ! -s $pid_file && i='' && break
@@ -163,8 +164,10 @@ wait_for_pid () {
if test -z "$i" ; then
log_success_msg
+ return 0
else
log_failure_msg
+ return 1
fi
}
@@ -277,26 +280,28 @@ case "$mode" in
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
$manager --user=$user --pid-file=$pid_file >/dev/null 2>&1 &
- wait_for_pid created
+ wait_for_pid created $!; return_value=$?
# Make lock for RedHat / SuSE
if test -w /var/lock/subsys
then
touch /var/lock/subsys/mysqlmanager
fi
+ exit $return_value
elif test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
pid_file=$server_pid_file
$bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
- wait_for_pid created
+ wait_for_pid created $!; return_value=$?
# Make lock for RedHat / SuSE
if test -w /var/lock/subsys
then
touch /var/lock/subsys/mysql
fi
+ exit $return_value
else
log_failure_msg "Couldn't find MySQL manager or server"
fi
@@ -322,13 +327,14 @@ case "$mode" in
echo $echo_n "Shutting down MySQL"
kill $mysqlmanager_pid
# mysqlmanager should remove the pid_file when it exits, so wait for it.
- wait_for_pid removed
+ wait_for_pid removed; return_value=$?
# delete lock for RedHat / SuSE
if test -f $lock_dir
then
rm -f $lock_dir
fi
+ exit $return_value
else
log_failure_msg "MySQL manager or server PID file could not be found!"
fi
@@ -337,8 +343,12 @@ case "$mode" in
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
- $0 stop $other_args
+ if $0 stop $other_args; then
$0 start $other_args
+ else
+ log_failure_msg "Failed to stop running server, so refusing to try to start."
+ exit 1
+ fi
;;
'reload')
@@ -357,3 +367,5 @@ case "$mode" in
exit 1
;;
esac
+
+exit 0
--- 1.19/BitKeeper/etc/collapsed 2007-01-31 15:39:45 -05:00
+++ 1.20/BitKeeper/etc/collapsed 2007-01-31 15:39:45 -05:00
@@ -30,3 +30,9 @@
4554b3722d71SbPiI2Gx-RhbZjmuIQ
4558b3d73Cxjlb7Wv1oytdSTthxDfw
45771031yRCoM_ZfONdYchPvVEgLRg
+459a60d8rIxeTuhB3j_QsOwLGdcpng
+459a61c9OS8PzIsdviZJDkybJ1y1uA
+459a70691aYIfU2ohV0a3P5iTLpO2A
+459a7422KF_P7PuU3YQ5qG6ZLEVpiA
+459a74e4nRcXppMSBYeQQ5efDkTADg
+45c0fdfb2mz6NdOIsLenJtf6_ZelTA
| Thread |
|---|
| • bk commit into 5.0 tree (cmiller:1.2361) BUG#25341 | Chad MILLER | 31 Jan |