[csw-devel] SF.net SVN: gar:[15832] csw/mgar/pkg/mysql5/branches/mysql-5.0.x
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Sun Oct 2 23:04:25 CEST 2011
Revision: 15832
http://gar.svn.sourceforge.net/gar/?rev=15832&view=rev
Author: wahwah
Date: 2011-10-02 21:04:25 +0000 (Sun, 02 Oct 2011)
Log Message:
-----------
pkg/mysql5/branches/mysql-5.0.x: alternatives corrected, startup script updated
Modified Paths:
--------------
csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile
Added Paths:
-----------
csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5.tpl
Removed Paths:
-------------
csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5
Modified: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile 2011-10-02 14:12:29 UTC (rev 15831)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile 2011-10-02 21:04:25 UTC (rev 15832)
@@ -56,9 +56,9 @@
ALTERNATIVES_CSWmysql-dev = mysql_dev
ALTERNATIVE_mysql_dev = $(global_bindir)/$(firstword $(CSWmysql-dev_programs)) mysql $(bindir)/$(firstword $(CSWmysql-dev_programs)) 50
ALTERNATIVE_mysql_dev += $(foreach C,$(wordlist 2,$(words $(CSWmysql-dev_programs)),$(CSWmysql-dev_programs)),\
- $(bindir)/$C-$(BASE_VERSION) $C $(bindir)/$C)
+ $(bindir)/$C $C $(bindir)/$C-$(BASE_VERSION))
ALTERNATIVE_mysql_dev += $(foreach C,$(wordlist 2,$(words $(CSWmysql-dev_programs)),$(CSWmysql-dev_programs)),\
- $(mandir)/man1/$C-$(BASE_VERSION).1 $C $(mandir)/man1/$(C).1)
+ $(mandir)/man1/$(C).1 $C $(mandir)/man1/$(C)-$(BASE_VERSION).1)
PACKAGES += CSWlibmysqlclient$(MYSQL_LIB_VER)
PKGFILES_CSWlibmysqlclient$(MYSQL_LIB_VER) += $(call baseisadirs,$(libdir),libmysqlclient\.so\.$(MYSQL_LIB_VER)(\.\d+)*)
@@ -101,6 +101,7 @@
RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient$(MYSQL_LIB_VER)
RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibncursesw5
RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibz1
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWalternatives
CHECKPKG_OVERRIDES_CSWmysql5client += bad-rpath-entry
PACKAGES += CSW$(NAME)
@@ -110,6 +111,7 @@
RUNTIME_DEP_PKGS_CSW$(NAME) += CSW$(NAME)client
RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibz1
RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibwrap1
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWalternatives
CHECKPKG_OVERRIDES_CSW$(NAME) += bad-rpath-entry
CHECKPKG_OVERRIDES_CSW$(NAME) += file-with-bad-content
@@ -142,7 +144,10 @@
MASTER_SITES = http://ftp.heanet.ie/mirrors/www.mysql.com/Downloads/MySQL-$(BASE_VERSION)/
DISTFILES = mysql-$(VERSION).tar.gz
-DISTFILES += csw$(NAME) quick_start-csw README.CSW ChangeLog
+DISTFILES += csw$(NAME).tpl
+DISTFILES += quick_start-csw
+DISTFILES += README.CSW
+DISTFILES += ChangeLog
DISTFILES += CSW$(NAME).preinstall
DISTFILES += CSW$(NAME).postinstall
DISTFILES += cswusergroup
@@ -252,9 +257,9 @@
ALTERNATIVES_CSW$(NAME)client = mysql$(BASE_VERSION)
ALTERNATIVE_mysql$(BASE_VERSION) = $(global_bindir)/$(firstword $(CSW$(NAME)client_programs)) mysql $(bindir)/$(firstword $(CSW$(NAME)client_programs)) 50
ALTERNATIVE_mysql$(BASE_VERSION) += $(foreach C,$(wordlist 2,$(words $(CSW$(NAME)client_programs)),$(CSW$(NAME)client_programs)),\
- $(bindir)/$C-$(BASE_VERSION) $C $(bindir)/$C)
+ $(bindir)/$C $C $(bindir)/$C-$(BASE_VERSION))
ALTERNATIVE_mysql$(BASE_VERSION) += $(foreach C,$(wordlist 2,$(words $(CSW$(NAME)client_programs)),$(CSW$(NAME)client_programs)),\
- $(mandir)/man1/$C-$(BASE_VERSION).1 $C $(mandir)/man1/$(C).1)
+ $(mandir)/man1/$(C).1 $C $(mandir)/man1/$(C)-$(BASE_VERSION).1)
include gar/category.mk
@@ -289,7 +294,14 @@
gln -sf ../../../$(NAME)/share/$(NAME)/doc/README.CSW \
$(PKGROOT)/opt/csw/share/$(NAME)/doc/README.CSW
ginstall -m 755 -d $(PKGROOT)$(sysconfdir)/init.d
- ginstall -m 755 $(FILEDIR)/csw$(NAME) $(PKGROOT)$(sysconfdir)/init.d
+ gsed \
+ -e 's+ at prefix@+$(prefix)+' \
+ -e 's+ at varstatedir@+$(varstatedir)+' \
+ -e 's+ at sysconfdir@+$(sysconfdir)+' \
+ -e 's+ at bindir@+$(bindir)+' \
+ < $(WORKDIR)/csw$(NAME).tpl \
+ > $(WORKDIR)/csw$(NAME)
+ ginstall -m 755 $(WORKDIR)/csw$(NAME) $(PKGROOT)$(sysconfdir)/init.d
ginstall -m 755 $(FILEDIR)/quick_start-csw $(PKGROOT)$(datadir)/mysql
ginstall -m 755 -d $(PKGROOT)$(global_sysconfdir)/pkg/CSW$(NAME)
ginstall -m 644 $(FILEDIR)/cswusergroup \
Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5 2011-10-02 14:12:29 UTC (rev 15831)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5 2011-10-02 21:04:25 UTC (rev 15832)
@@ -1,203 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-# Start script for MySQL database.
-#
-# NOTE: Make sure DB_DIR is owned BY the mysql user and group and chmod
-# 700.
-#
-# First time installation can use quick_start-csw in
-# /opt/csw/mysql5/share/mysql to build the mysql database for the
-# grant tables. Or create the initial database yourself.
-#
-# Use my.cnf for startup options. See MySQL documention
-# for 'Using Option Files'.
-# Support for mysql5rc still remains in this startup script.
-#
-
-RETVAL=0
-prefix="/opt/csw/mysql5"
-BASEDIR="${prefix}"
-MYSQL_VAR="/var${prefix}"
-sysconfdir="/etc${prefix}"
-MYSQLD_DATADIR=$MYSQL_VAR
-MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
-CONFFILE=${sysconfdir}/my.cnf
-
-#
-# Source configuration
-[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
-[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
-
-if [ -r "${sysconfdir}/my.cnf" ]; then
- MYSQL_HOME="${MYSQL_VAR}"
-elif [ -r "${BASEDIR}/my.cnf" ]; then
- MYSQL_HOME="${BASEDIR}"
-fi
-export MYSQL_HOME
-
-# To get started quickly, copy a sample configuration file from
-# $BASEDIR/share/mysql
-# For example,
-# cp /opt/csw/mysql5/share/mysql/my-medium.cnf /opt/csw/mysql5/var/my.cnf
-#
-# Or, manually follow the database creation steps below, and have
-# mysql just use defaults for everything.
-
-# 2006-03-11 Changed to only look for the grant tables database
-# 2006-04-16 Changed again. Look for either the grant tables database
-# or the options file.
-# 2006-12-28 Fix problem. Look for either the grant tables database in
-# the default location or the default options file.
-if [ ! -d "$MYSQLD_DATADIR/mysql" -a ! -f "$CONFFILE" ] ; then
- exit 0
-fi
-
-# If CONFFILE is the server default file, unset CONFFILE
-if [ "${CONFFILE}" = "${MYSQL_HOME}/my.cnf" \
- -o \
- "${CONFFILE}" = "${sysconfdir}/my.cnf" ]; then
- CONFFILE=
-fi
-
-# If MYSQLD_DATADIR does not contain a mysql directory, unset MYSQLD_DATADIR
-# Also, check that MYSQLD_DATADIR contains a mysql directory
-if [ ! -d "$MYSQL_HOME/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
- MYSQLD_DATADIR=
-fi
-
-# Make sure required vars are set
-MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_HOME/mysql.pid}
-
-# If a database already exists, start whether or not there is a conf file.
-# If no conf file, the database will just use internal defaults for everything.
-
-start_it() {
- if test -r $MYSQLD_PID_FILE ; then
- if kill -0 `cat $MYSQLD_PID_FILE` > /dev/null 2>&1 ; then
- echo "mysqld (`cat $MYSQLD_PID_FILE`) seems to be running."
- return 1
- fi
- fi
-
- printf "%-60s" "Starting mysqld: "
-
- # 2006-03-11
- # This script no longer creates the default database. You may create the
- # default database manually or use
- # /opt/csw/mysql5/share/mysql/quick_start-csw
- # if [ ! -d "$BASEDIR/var/mysql" ] ; then
- # echo MySQL core database has not been created.
- # echo Creating it now...
- # $BASEDIR/bin/mysql_install_db
- # chown -R mysql:mysql $BASEDIR/var
- # fi
-
- # 2006-04-16 --defaults-file is changed to --defaults-extra-file
- $BASEDIR/bin/mysqld_safe \
- `[ -n "$CONFFILE" ] && echo "--defaults-extra-file=$CONFFILE"` \
- --pid-file=$MYSQLD_PID_FILE \
- `[ -n "$MYSQLD_PROG" ] && echo "--mysqld=$MYSQLD_PROG"` \
- `[ -n "$MYSQLD_ANSI" ] && echo "--ansi"` \
- `[ -n "$MYSQLD_BASEDIR" ] && echo "--basedir=$MYSQLD_BASEDIR"` \
- `[ -n "$MYSQLD_BIG_TABLES" ] && echo "--big-tables"` \
- `[ -n "$MYSQLD_BIND_ADDRESS" ] && echo "--bind-address=$MYSQLD_BIND_ADDRESS"` \
- `[ -n "$MYSQLD_CHARACTER_SETS" ] && echo "--character-sets-dir=$MYSQLD_CHARACTER_SETS"` \
- `[ -n "$MYSQLD_CHROOT" ] && echo "--chroot=$MYSQLD_CHROOT"` \
- `[ -n "$MYSQLD_DATADIR" ] && echo "--datadir=$MYSQLD_DATADIR"` \
- `[ -n "$MYSQLD_DEFAULT_CHARSET" ] && echo "--default-character-set=$MYSQLD_DEFAULT_CHARSET"` \
- `[ -n "$MYSQLD_DEFAULT_TABLE_TYPE" ] && echo "--default-table-type=$MYSQLD_DEFAULT_TABLE_TYPE"` \
- `[ -n "$MYSQLD_DELAY_KEY_WRITE_TABLES" ] && echo "--delay-key-write-for-all-tables"` \
- `[ -n "$MYSQLD_ENABLE_LOCKING" ] && echo "--enable-locking"` \
- `[ -n "$MYSQLD_EXIT_INFO" ] && echo "--exit-info"` \
- `[ -n "$MYSQLD_FLUSH" ] && echo "--flush"` \
- `[ -n "$MYSQLD_INIT_FILE" ] && echo "--init-file=$MYSQLD_INIT_FILE"` \
- `[ -n "$MYSQLD_LANGUAGE" ] && echo "--language=$MYSQLD_LANGUAGE"` \
- `[ -n "$MYSQLD_LOG" ] && echo "--log=$MYSQLD_LOG"` \
- `[ -n "$MYSQLD_LOG_ISAM" ] && echo "--log-isam=$MYSQLD_LOG_ISAM"` \
- `[ -n "$MYSQLD_LOG_SLOW_QUERIES" ] && echo "--log-slow-queries=$MYSQLD_LOG_SLOW_QUERIES"` \
- `[ -n "$MYSQLD_LOG_UPDATE" ] && echo "--log-update=$MYSQLD_LOG_UPDATE"` \
- `[ -n "$MYSQLD_LOG_LONG_FORMAT" ] && echo "--log-long-format"` \
- `[ -n "$MYSQLD_LOW_PRIORITY_UPDATES" ] && echo "--low-priority-updates"` \
- `[ -n "$MYSQLD_MEMLOCK" ] && echo "--memlock"` \
- `[ -n "$MYSQLD_MYISAM_RECOVER" ] && echo "--myisam-recover=$MYSQLD_MYISAM_RECOVER"` \
- `[ -n "$MYSQLD_PORT" ] && echo "--port=$MYSQLD_PORT"` \
- `[ -n "$MYSQLD_OLD_PROTOCOL" ] && echo "--old-protocol"` \
- `[ -n "$MYSQLD_ONE_THREAD" ] && echo "--one-thread"` \
- `[ -n "$MYSQLD_SET_VARIABLE" ] && echo "--set-variablevar=$MYSQLD_SET_VARIABLE"` \
- `[ -n "$MYSQLD_SKIP_GRANT_TABLES" ] && echo "--skip-grant-tables"` \
- `[ -n "$MYSQLD_SAFE_MODE" ] && echo "--safe-mode"` \
- `[ -n "$MYSQLD_SECURE" ] && echo "--secure"` \
- `[ -n "$MYSQLD_SKIP_CONCURRENT_INSERT" ] && echo "--skip-concurrent-insert"` \
- `[ -n "$MYSQLD_SKIP_DELAY_KEY_WRITE" ] && echo "--skip-delay-key-write"` \
- `[ -n "$MYSQLD_SKIP_LOCKING" ] && echo "--skip-locking"` \
- `[ -n "$MYSQLD_SKIP_NAME_RESOLVE" ] && echo "--skip-name-resolve"` \
- `[ -n "$MYSQLD_SKIP_NETWORKING" ] && echo "--skip-networking"` \
- `[ -n "$MYSQLD_SKIP_NEW" ] && echo "--skip-new"` \
- `[ -n "$MYSQLD_SKIP_HOST_CACHE" ] && echo "--skip-host-cache"` \
- `[ -n "$MYSQLD_SKIP_SHOW_DATABASE" ] && echo "--skip-show-database"` \
- `[ -n "$MYSQLD_SKIP_THREAD_PRIORITY" ] && echo "--skip-thread-priority"` \
- `[ -n "$MYSQLD_SOCKET" ] && echo "--socket=$MYSQLD_SOCKET"` \
- `[ -n "$MYSQLD_TMPDIR" ] && echo "--tmpdir=$MYSQLD_TMPDIR"` \
- `[ -n "$MYSQLD_USER" ] && echo "--user=$MYSQLD_USER"` \
- & >/dev/null 2>&1
- RETVAL=$?
- if [ $RETVAL = 0 ] ; then
- echo "[ OK ]"
- else
- echo "[FAILED]"
- return 1
- fi
- return 0
-}
-
-stop_it() {
-
- printf "%-60s" "Shutting down mysqld: "
- if test -f "$MYSQLD_PID_FILE" ; then
- pkill `pgrep_opts` mysqld_safe >/dev/null 2>&1
- kill `cat $MYSQLD_PID_FILE` >/dev/null 2>&1
- RETVAL=$?
- else
- RETVAL=1
- fi
- if [ $RETVAL = 0 ] ; then
- echo "[ OK ]"
- else
- echo "[FAILED]"
- fi
- echo ""
- return 0
-}
-
-pgrep_opts() {
- if [ -x /bin/zonename ]
- then
- echo "-z `/bin/zonename`"
- fi
-}
-
-case $1 in
- start)
- start_it
- ;;
-
- stop)
- stop_it
- ;;
-
- restart)
- stop_it
- while pgrep `pgrep_opts` mysqld > /dev/null
- do
- sleep 1
- done
- start_it
- ;;
-
- *)
- echo "Usage: $0 { start | stop | restart } "
- ;;
-esac
-
-exit $RETVAL
Copied: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5.tpl (from rev 15728, csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5.tpl (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5.tpl 2011-10-02 21:04:25 UTC (rev 15832)
@@ -0,0 +1,205 @@
+#!/bin/sh
+# vim:ft=sh:
+#
+# $Id$
+# Start script for MySQL database.
+#
+# NOTE: Make sure DB_DIR is owned BY the mysql user and group and chmod
+# 700.
+#
+# First time installation can use quick_start-csw in
+# /opt/csw/mysql5/share/mysql to build the mysql database for the
+# grant tables. Or create the initial database yourself.
+#
+# Use my.cnf for startup options. See MySQL documention
+# for 'Using Option Files'.
+# Support for mysql5rc still remains in this startup script.
+#
+
+RETVAL=0
+prefix="@prefix@"
+BASEDIR="${prefix}"
+BINDIR="@bindir@"
+MYSQL_VAR="@varstatedir@"
+sysconfdir="@sysconfdir@"
+MYSQLD_DATADIR=$MYSQL_VAR
+MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
+CONFFILE=${sysconfdir}/my.cnf
+
+# Source the configuration
+[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
+[ -r @prefix@/etc/mysql5rc ] && . @prefix@/etc/mysql5rc
+[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
+
+if [ -r "${sysconfdir}/my.cnf" ]; then
+ MYSQL_HOME="${MYSQL_VAR}"
+elif [ -r "${BASEDIR}/my.cnf" ]; then
+ MYSQL_HOME="${BASEDIR}"
+fi
+export MYSQL_HOME
+
+# To get started quickly, copy a sample configuration file from
+# $BASEDIR/share/mysql
+# For example,
+# cp /opt/csw/mysql5/share/mysql/my-medium.cnf /opt/csw/mysql5/var/my.cnf
+#
+# Or, manually follow the database creation steps below, and have
+# mysql just use defaults for everything.
+
+# 2006-03-11 Changed to only look for the grant tables database
+# 2006-04-16 Changed again. Look for either the grant tables database
+# or the options file.
+# 2006-12-28 Fix problem. Look for either the grant tables database in
+# the default location or the default options file.
+if [ ! -d "$MYSQLD_DATADIR/mysql" -a ! -f "$CONFFILE" ] ; then
+ exit 0
+fi
+
+# If CONFFILE is the server default file, unset CONFFILE
+if [ "${CONFFILE}" = "${MYSQL_HOME}/my.cnf" \
+ -o \
+ "${CONFFILE}" = "${sysconfdir}/my.cnf" ]; then
+ CONFFILE=
+fi
+
+# If MYSQLD_DATADIR does not contain a mysql directory, unset MYSQLD_DATADIR
+# Also, check that MYSQLD_DATADIR contains a mysql directory
+if [ ! -d "$MYSQL_HOME/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
+ MYSQLD_DATADIR=
+fi
+
+# Make sure required vars are set
+MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_HOME/mysql.pid}
+
+# If a database already exists, start whether or not there is a conf file.
+# If no conf file, the database will just use internal defaults for everything.
+
+start_it() {
+ if test -r $MYSQLD_PID_FILE ; then
+ if kill -0 `cat $MYSQLD_PID_FILE` > /dev/null 2>&1 ; then
+ echo "mysqld (`cat $MYSQLD_PID_FILE`) seems to be running."
+ return 1
+ fi
+ fi
+
+ printf "%-60s" "Starting mysqld: "
+
+ # 2006-03-11
+ # This script no longer creates the default database. You may create the
+ # default database manually or use
+ # /opt/csw/mysql5/share/mysql/quick_start-csw
+ # if [ ! -d "$BASEDIR/var/mysql" ] ; then
+ # echo MySQL core database has not been created.
+ # echo Creating it now...
+ # $BASEDIR/bin/mysql_install_db
+ # chown -R mysql:mysql $BASEDIR/var
+ # fi
+
+ # 2006-04-16 --defaults-file is changed to --defaults-extra-file
+ ${BINDIR}/mysqld_safe \
+ `[ -n "$CONFFILE" ] && echo "--defaults-extra-file=$CONFFILE"` \
+ --pid-file=$MYSQLD_PID_FILE \
+ `[ -n "$MYSQLD_PROG" ] && echo "--mysqld=$MYSQLD_PROG"` \
+ `[ -n "$MYSQLD_ANSI" ] && echo "--ansi"` \
+ `[ -n "$MYSQLD_BASEDIR" ] && echo "--basedir=$MYSQLD_BASEDIR"` \
+ `[ -n "$MYSQLD_BIG_TABLES" ] && echo "--big-tables"` \
+ `[ -n "$MYSQLD_BIND_ADDRESS" ] && echo "--bind-address=$MYSQLD_BIND_ADDRESS"` \
+ `[ -n "$MYSQLD_CHARACTER_SETS" ] && echo "--character-sets-dir=$MYSQLD_CHARACTER_SETS"` \
+ `[ -n "$MYSQLD_CHROOT" ] && echo "--chroot=$MYSQLD_CHROOT"` \
+ `[ -n "$MYSQLD_DATADIR" ] && echo "--datadir=$MYSQLD_DATADIR"` \
+ `[ -n "$MYSQLD_DEFAULT_CHARSET" ] && echo "--default-character-set=$MYSQLD_DEFAULT_CHARSET"` \
+ `[ -n "$MYSQLD_DEFAULT_TABLE_TYPE" ] && echo "--default-table-type=$MYSQLD_DEFAULT_TABLE_TYPE"` \
+ `[ -n "$MYSQLD_DELAY_KEY_WRITE_TABLES" ] && echo "--delay-key-write-for-all-tables"` \
+ `[ -n "$MYSQLD_ENABLE_LOCKING" ] && echo "--enable-locking"` \
+ `[ -n "$MYSQLD_EXIT_INFO" ] && echo "--exit-info"` \
+ `[ -n "$MYSQLD_FLUSH" ] && echo "--flush"` \
+ `[ -n "$MYSQLD_INIT_FILE" ] && echo "--init-file=$MYSQLD_INIT_FILE"` \
+ `[ -n "$MYSQLD_LANGUAGE" ] && echo "--language=$MYSQLD_LANGUAGE"` \
+ `[ -n "$MYSQLD_LOG" ] && echo "--log=$MYSQLD_LOG"` \
+ `[ -n "$MYSQLD_LOG_ISAM" ] && echo "--log-isam=$MYSQLD_LOG_ISAM"` \
+ `[ -n "$MYSQLD_LOG_SLOW_QUERIES" ] && echo "--log-slow-queries=$MYSQLD_LOG_SLOW_QUERIES"` \
+ `[ -n "$MYSQLD_LOG_UPDATE" ] && echo "--log-update=$MYSQLD_LOG_UPDATE"` \
+ `[ -n "$MYSQLD_LOG_LONG_FORMAT" ] && echo "--log-long-format"` \
+ `[ -n "$MYSQLD_LOW_PRIORITY_UPDATES" ] && echo "--low-priority-updates"` \
+ `[ -n "$MYSQLD_MEMLOCK" ] && echo "--memlock"` \
+ `[ -n "$MYSQLD_MYISAM_RECOVER" ] && echo "--myisam-recover=$MYSQLD_MYISAM_RECOVER"` \
+ `[ -n "$MYSQLD_PORT" ] && echo "--port=$MYSQLD_PORT"` \
+ `[ -n "$MYSQLD_OLD_PROTOCOL" ] && echo "--old-protocol"` \
+ `[ -n "$MYSQLD_ONE_THREAD" ] && echo "--one-thread"` \
+ `[ -n "$MYSQLD_SET_VARIABLE" ] && echo "--set-variablevar=$MYSQLD_SET_VARIABLE"` \
+ `[ -n "$MYSQLD_SKIP_GRANT_TABLES" ] && echo "--skip-grant-tables"` \
+ `[ -n "$MYSQLD_SAFE_MODE" ] && echo "--safe-mode"` \
+ `[ -n "$MYSQLD_SECURE" ] && echo "--secure"` \
+ `[ -n "$MYSQLD_SKIP_CONCURRENT_INSERT" ] && echo "--skip-concurrent-insert"` \
+ `[ -n "$MYSQLD_SKIP_DELAY_KEY_WRITE" ] && echo "--skip-delay-key-write"` \
+ `[ -n "$MYSQLD_SKIP_LOCKING" ] && echo "--skip-locking"` \
+ `[ -n "$MYSQLD_SKIP_NAME_RESOLVE" ] && echo "--skip-name-resolve"` \
+ `[ -n "$MYSQLD_SKIP_NETWORKING" ] && echo "--skip-networking"` \
+ `[ -n "$MYSQLD_SKIP_NEW" ] && echo "--skip-new"` \
+ `[ -n "$MYSQLD_SKIP_HOST_CACHE" ] && echo "--skip-host-cache"` \
+ `[ -n "$MYSQLD_SKIP_SHOW_DATABASE" ] && echo "--skip-show-database"` \
+ `[ -n "$MYSQLD_SKIP_THREAD_PRIORITY" ] && echo "--skip-thread-priority"` \
+ `[ -n "$MYSQLD_SOCKET" ] && echo "--socket=$MYSQLD_SOCKET"` \
+ `[ -n "$MYSQLD_TMPDIR" ] && echo "--tmpdir=$MYSQLD_TMPDIR"` \
+ `[ -n "$MYSQLD_USER" ] && echo "--user=$MYSQLD_USER"` \
+ & >/dev/null 2>&1
+ RETVAL=$?
+ if [ $RETVAL = 0 ] ; then
+ echo "[ OK ]"
+ else
+ echo "[FAILED]"
+ return 1
+ fi
+ return 0
+}
+
+stop_it() {
+
+ printf "%-60s" "Shutting down mysqld: "
+ if test -f "$MYSQLD_PID_FILE" ; then
+ pkill `pgrep_opts` mysqld_safe >/dev/null 2>&1
+ kill `cat $MYSQLD_PID_FILE` >/dev/null 2>&1
+ RETVAL=$?
+ else
+ RETVAL=1
+ fi
+ if [ $RETVAL = 0 ] ; then
+ echo "[ OK ]"
+ else
+ echo "[FAILED]"
+ fi
+ echo ""
+ return 0
+}
+
+pgrep_opts() {
+ if [ -x /bin/zonename ]
+ then
+ echo "-z `/bin/zonename`"
+ fi
+}
+
+case $1 in
+ start)
+ start_it
+ ;;
+
+ stop)
+ stop_it
+ ;;
+
+ restart)
+ stop_it
+ while pgrep `pgrep_opts` mysqld > /dev/null
+ do
+ sleep 1
+ done
+ start_it
+ ;;
+
+ *)
+ echo "Usage: $0 { start | stop | restart } "
+ ;;
+esac
+
+exit $RETVAL
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list