[packages/percona-server/v5.0.x: 187/202] move status action to status function
glen
glen at pld-linux.org
Wed Oct 21 16:24:45 CEST 2015
commit 6fd42edde7e200634d0c1d7c84152b6791104556
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Apr 25 10:45:21 2013 +0300
move status action to status function
mysql.init | 72 +++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 38 insertions(+), 34 deletions(-)
---
diff --git a/mysql.init b/mysql.init
index 6fd8002..696ba03 100755
--- a/mysql.init
+++ b/mysql.init
@@ -628,40 +628,7 @@ condrestart() {
start
}
-RETVAL=0
-case "$action" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- try-restart)
- condrestart 0
- ;;
- force-reload)
- condrestart 7
- ;;
- init)
- for mysqldir in $DB_CLUSTERS; do
- mysqlinit "$mysqldir"
- done
- exit $?
- ;;
- flush-logs)
- for mysqldir in $DB_CLUSTERS; do
- mysqlgetconfig "$mysqldir"
- # just if mysqld is really running
- if /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then
- /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs
- fi
- done
- ;;
- status)
+status() {
RETVAL=3
for mysqldir in $DB_CLUSTERS; do
mysqlstatus "$mysqldir"
@@ -718,6 +685,43 @@ case "$action" in
echo
done
fi
+}
+
+RETVAL=0
+case "$action" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ init)
+ for mysqldir in $DB_CLUSTERS; do
+ mysqlinit "$mysqldir"
+ done
+ exit $?
+ ;;
+ flush-logs)
+ for mysqldir in $DB_CLUSTERS; do
+ mysqlgetconfig "$mysqldir"
+ # just if mysqld is really running
+ if /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then
+ /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs
+ fi
+ done
+ ;;
+ status)
+ status
;;
*)
msg_usage "$0 {start|stop|restart|try-restart|force-reload|init|flush-logs|status}"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/percona-server.git/commitdiff/431f68fe79a66d5dfdd53f2655709e6c925fbc22
More information about the pld-cvs-commit
mailing list