http://meetbill.github.io/
分类: LINUX
2016-03-02 16:56:51
# If you've removed anonymous users, this line must be changed to # use a user that is allowed to ping mysqld. ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping" # Spin for a maximum of ten seconds waiting for the server to come up if [ $ret -eq 0 ]; then for x in 1 2 3 4 5 6 7 8 9 10; do if [ -n "`$ping 2> /dev/null`" ]; then break; else sleep 1; fi done if !([ -n "`$ping 2> /dev/null`" ]); then echo "Timeout error occurred trying to start MySQL Daemon." action $"Starting $prog: " /bin/false else action $"Starting $prog: " /bin/true fi else action $"Starting $prog: " /bin/false fi [ $ret -eq 0 ] && touch /var/lock/subsys/mysqld return $ret |