]> git.pld-linux.org Git - packages/percona-server.git/commitdiff
- use functions for start and stop to speedup restart
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 12 Oct 2006 21:32:38 +0000 (21:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mysql.init -> 1.102

mysql.init

index 7e4c2d557ca1784712fe68d8e282fc28eb31e85b..93986b298c34798379ff18082961f07d0ebe39f4 100644 (file)
@@ -825,9 +825,7 @@ END_OF_MSG
 # End of useful functions.
 #
 
-RETVAL=0
-case "$action" in
-  start)
+start() {
        if [ ! -f $MYSQL_ERRLOG ]; then
                touch $MYSQL_ERRLOG
        fi
@@ -843,8 +841,9 @@ case "$action" in
                fi
        done
        mysqlsubsys
-       ;;
-  stop)
+}
+
+stop() {
        for mysqldir in $DB_CLUSTERS; do
                mysqlstatus "$mysqldir" stop
                if [ "$MYSQL_STATUS" = "not running" ]; then
@@ -854,6 +853,15 @@ case "$action" in
                fi
        done
        mysqlsubsys
+}
+
+RETVAL=0
+case "$action" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        for mysqldir in $DB_CLUSTERS; do
@@ -870,9 +878,8 @@ case "$action" in
        exit $?
        ;;
   restart|force-reload)
-       $0 stop $DB_CLUSTERS
-       $0 start $DB_CLUSTERS
-       exit $?
+       stop
+       start
        ;;
   init)
        for mysqldir in $DB_CLUSTERS; do
This page took 0.040639 seconds and 4 git commands to generate.