diff options
author | unknown <mtaylor@qualinost.(none)> | 2007-03-13 06:06:09 -0700 |
---|---|---|
committer | unknown <mtaylor@qualinost.(none)> | 2007-03-13 06:06:09 -0700 |
commit | 105310c8d5b5ecd20c6dde386f0e36fc2ba24e57 (patch) | |
tree | 5eb0c8632e6758ff1558a7675e94c5a497762d03 /support-files/mysql.server.sh | |
parent | 0a5780bc03a8876851fbaa4a0cfb8caa680c0535 (diff) | |
download | mariadb-git-105310c8d5b5ecd20c6dde386f0e36fc2ba24e57.tar.gz |
BUG#26952: mysql.server needs to be able to not timeout in certain situations
For systems running MySQL through heartbeat, it is imperitive that the startup scripts
not only return correct return values, but do not return until success or failure has been
determined. This is a different behavior than is typically wanted for the startup
of a normal machine.
This patch adds support for a timeout variable for mysql.server. Read from my.cnf, this
variable defaults to 900 (the current default). A value of 0 means not to wait at all for
startup confirmation. A negative value means to wait forever.
support-files/mysql.server.sh:
Added support for a timeout variable to control timing out our wait for server startup. BUG#26952
Diffstat (limited to 'support-files/mysql.server.sh')
-rw-r--r-- | support-files/mysql.server.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 9258fcf10c2..65b56443eea 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -46,6 +46,13 @@ basedir= datadir= +# Default value, in seconds, afterwhich the script should timeout waiting +# for server start. +# Value here is overriden by value in my.cnf. +# 0 means don't wait at all +# Negative numbers mean to wait indefinitely +service_startup_timeout=900 + # The following variables are only set for letting mysql.server find things. # Set some defaults @@ -126,6 +133,7 @@ parse_server_arguments() { ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --use-mysqld_safe) use_mysqld_safe=1;; --use-manager) use_mysqld_safe=0;; esac @@ -143,7 +151,7 @@ parse_manager_arguments() { wait_for_pid () { i=0 - while test $i -lt 900 ; do + while test $i -ne $service_startup_timeout ; do sleep 1 case "$1" in 'created') |