summaryrefslogtreecommitdiffstats
path: root/mysql.init
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2011-05-31 18:04:52 +0200
committerRemi Collet <fedora@famillecollet.com>2011-05-31 18:04:52 +0200
commite101711a96d0dfee6d458a077d9462afde0ba527 (patch)
treebcefc9a04e4c0d346f0aad0ae40a1c52ffd12b48 /mysql.init
parent770610310272f771215928aad63da56b2044498d (diff)
mysql: sync with f15
Diffstat (limited to 'mysql.init')
-rw-r--r--mysql.init23
1 files changed, 22 insertions, 1 deletions
diff --git a/mysql.init b/mysql.init
index e9daedc..99c3c61 100644
--- a/mysql.init
+++ b/mysql.init
@@ -8,6 +8,15 @@
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid
+### BEGIN INIT INFO
+# Provides: mysqld
+# Required-Start: $local_fs $remote_fs $network $named $syslog $time
+# Required-Stop: $local_fs $remote_fs $network $named $syslog $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start and stop MySQL server
+# Description: MySQL database server
+### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
@@ -113,7 +122,19 @@ start(){
ret=0
TIMEOUT="$STARTTIMEOUT"
while [ $TIMEOUT -gt 0 ]; do
- RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break
+ RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
+ mret=$?
+ if [ $mret -eq 0 ]; then
+ break
+ fi
+ # exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
+ # anything else suggests a configuration error
+ if [ $mret -ne 1 -a $mret -ne 11 ]; then
+ echo "$RESPONSE"
+ echo "Cannot check for MySQL Daemon startup because of mysqladmin failure."
+ ret=1
+ break
+ fi
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."