[csw-devel] SF.net SVN: gar:[17063] csw/mgar/pkg/mysql5/branches/mysql-5.1.x
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Wed Feb 15 18:16:29 CET 2012
Revision: 17063
http://gar.svn.sourceforge.net/gar/?rev=17063&view=rev
Author: wahwah
Date: 2012-02-15 17:16:29 +0000 (Wed, 15 Feb 2012)
Log Message:
-----------
mysql5/branches/mysql-5.1.x: port some changes from 5.0 to 5.1
Modified Paths:
--------------
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/Makefile
Added Paths:
-----------
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.postinstall
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.preinstall
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql5
Removed Paths:
-------------
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.postinstall
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.preinstall
csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql51
Modified: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/Makefile 2012-02-15 14:33:46 UTC (rev 17062)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/Makefile 2012-02-15 17:16:29 UTC (rev 17063)
@@ -3,7 +3,7 @@
# $Id$
PROJ_NAME = mysql
-NAME = $(PROJ_NAME)51
+NAME = $(PROJ_NAME)5
BASE_VERSION = 5.1
PATCHLEVEL = 59
VERSION = $(BASE_VERSION).$(PATCHLEVEL)
@@ -21,22 +21,17 @@
(Structured Query Language) database server.
endef
-# Change prefix to /opt/csw/$(NAME)
-prefix = $(BUILD_PREFIX)/$(NAME)
-localstatedir = /var$(prefix)
-sysconfdir = /etc$(prefix)
-libdir = $(BUILD_PREFIX)/lib
-includedir = $(BUILD_PREFIX)/include
-
-# Where to put the init script
-global_sysconfdir = /etc$(BUILD_PREFIX)
-# Where to link the binaries
-global_bindir = $(BUILD_PREFIX)/bin
-
INITSMF = $(sysconfdir)/init\.d/csw$(NAME)
+# Existing databases are in this location
+localstatedir = /var$(BUILD_PREFIX)/$(NAME)
+# To avoid file conflicts
+# datadir = $(prefix)/share/mysql/$(BASE_VERSION)
+
MYSQL_LIB_VER = 16
+MERGE_DIRS_isa-extra = $(bindir) $(libdir) $(sbindir) $(libexecdir)
+
PACKAGES += CSWmysql-dev
SPKG_DESC_CSWmysql-dev = MySQL development files
PKGFILES_CSWmysql-dev = $(PKGFILES_DEVEL)
@@ -56,29 +51,14 @@
PKGFILES_CSWlibmysqlclient$(MYSQL_LIB_VER) += $(call baseisadirs,$(libdir),libmysqlclient\.so\.$(MYSQL_LIB_VER)(\.\d+)*)
SPKG_DESC_CSWlibmysqlclient$(MYSQL_LIB_VER) += MySQL $(BASE_VERSION) client library, libmysqlclient.so.$(MYSQL_LIB_VER)
RUNTIME_DEP_PKGS_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSWlibz1
-RUNTIME_DEP_PKGS_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSWosslrt
OBSOLETED_BY_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSW$(NAME)rt
PACKAGES += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
PKGFILES_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += $(call baseisadirs,$(libdir),libmysqlclient_r\.so\.$(MYSQL_LIB_VER)(\.\d+)*)
SPKG_DESC_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += MySQL $(BASE_VERSION) client library, libmysqlclient_r.so.$(MYSQL_LIB_VER)
RUNTIME_DEP_PKGS_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSWlibz1
-RUNTIME_DEP_PKGS_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSWosslrt
OBSOLETED_BY_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSW$(NAME)rt
-PACKAGES += CSW$(NAME)client
-SPKG_DESC_CSW$(NAME)client = MySQL $(BASE_VERSION) client binaries
-RPKGFILES_CSW$(NAME)client = $(bindir)
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(call baseisadirs,$(bindir),$(bin_name)))
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(mandir)/man1/$(bin_name)\.1)
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/bin/$(bin_name))
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/sbin/$(bin_name))
-RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient$(MYSQL_LIB_VER)
-RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
-RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibncursesw5
-RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibz1
-RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWosslrt
-CHECKPKG_OVERRIDES_CSWmysql5client += bad-rpath-entry
# Defining the client programs, which are going to pick up the 32- and 64-bit
# binaries, symbolic links, isaexec stuff and man pages.
CSW$(NAME)client_programs += myisamlog
@@ -97,6 +77,19 @@
CSW$(NAME)client_programs += mysql_zap
CSW$(NAME)client_programs += perror
CSW$(NAME)client_programs += replace
+PACKAGES += CSW$(NAME)client
+SPKG_DESC_CSW$(NAME)client = MySQL $(BASE_VERSION) client binaries
+RPKGFILES_CSW$(NAME)client = $(bindir)
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(call baseisadirs,$(bindir),$(bin_name)))
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(mandir)/man1/$(bin_name)\.1)
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/bin/$(bin_name))
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/sbin/$(bin_name))
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibncursesw5
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibz1
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWosslrt
+CHECKPKG_OVERRIDES_CSWmysql5client += bad-rpath-entry
PACKAGES += CSW$(NAME)
RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
Copied: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.postinstall (from rev 16832, csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.postinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.postinstall (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.postinstall 2012-02-15 17:16:29 UTC (rev 17063)
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+MYSQLDATADIR=/var/opt/csw/mysql51
+if [ ! -d "${MYSQLDATADIR}/mysql" ] ; then
+ echo "No database directory found in the default location:"
+ echo "${MYSQLDATADIR}/mysql"
+ echo "If you need to build the initial database directory,"
+ echo " see /opt/csw/mysql5/share/mysql/quick_start-csw"
+ echo "If you are using a non-default database directory location,"
+ echo " please start mysql manually."
+ exit 0
+fi
Copied: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.preinstall (from rev 16832, csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.preinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.preinstall (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql5.preinstall 2012-02-15 17:16:29 UTC (rev 17063)
@@ -0,0 +1,40 @@
+#!/bin/sh
+# vim:set sw=2 ts=2 sts=2 expandtab:
+#
+# $Id$
+#
+
+obsolete_directories="/opt/csw/mysql51/var:/var/opt/csw/mysql51"
+
+obsolete_dir_information="
+This directory is obsolete. Files in this directory are going to be ignored.
+Please move your data to the new location.
+
+Feel free to remove this file afterwards.
+"
+obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
+
+for dirpair in ${obsolete_directories}; do
+ obsolete_dir=`echo ${dirpair} | cut -d: -f1`
+ new_dir=`echo ${dirpair} | cut -d: -f2`
+ if [ -d "${PKG_INSTALL_ROOT}${obsolete_dir}" ]; then
+ echo
+ echo "*******************************************************************"
+ echo "* The old configuration directory ${obsolete_dir} still exists. "
+ echo "* Please move your configuration to ${new_dir}. "
+ echo "* "
+ echo "* Installation will continue in 10 seconds. "
+ echo "* Press CTRL+C if you want to stop now. "
+ echo "*******************************************************************"
+ echo
+ sleep 10
+
+ # Leaving a note for the sysadmin if the they proceed with the installation.
+ fn="${PKG_INSTALL_ROOT}${obsolete_dir}/${obsolete_dir_file_name}"
+ if touch "${fn}" 2>/dev/null; then
+ echo "${obsolete_dir_information}" > "${fn}"
+ fi
+ fi
+done
+
+exit 0
Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.postinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.postinstall 2012-02-15 14:33:46 UTC (rev 17062)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.postinstall 2012-02-15 17:16:29 UTC (rev 17063)
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-MYSQLDATADIR=/var/opt/csw/mysql51
-if [ ! -d "${MYSQLDATADIR}/mysql" ] ; then
- echo "No database directory found in the default location:"
- echo "${MYSQLDATADIR}/mysql"
- echo "If you need to build the initial database directory,"
- echo " see /opt/csw/mysql5/share/mysql/quick_start-csw"
- echo "If you are using a non-default database directory location,"
- echo " please start mysql manually."
- exit 0
-fi
Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.preinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.preinstall 2012-02-15 14:33:46 UTC (rev 17062)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/CSWmysql51.preinstall 2012-02-15 17:16:29 UTC (rev 17063)
@@ -1,40 +0,0 @@
-#!/bin/sh
-# vim:set sw=2 ts=2 sts=2 expandtab:
-#
-# $Id$
-#
-
-obsolete_directories="/opt/csw/mysql51/var:/var/opt/csw/mysql51"
-
-obsolete_dir_information="
-This directory is obsolete. Files in this directory are going to be ignored.
-Please move your data to the new location.
-
-Feel free to remove this file afterwards.
-"
-obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
-
-for dirpair in ${obsolete_directories}; do
- obsolete_dir=`echo ${dirpair} | cut -d: -f1`
- new_dir=`echo ${dirpair} | cut -d: -f2`
- if [ -d "${PKG_INSTALL_ROOT}${obsolete_dir}" ]; then
- echo
- echo "*******************************************************************"
- echo "* The old configuration directory ${obsolete_dir} still exists. "
- echo "* Please move your configuration to ${new_dir}. "
- echo "* "
- echo "* Installation will continue in 10 seconds. "
- echo "* Press CTRL+C if you want to stop now. "
- echo "*******************************************************************"
- echo
- sleep 10
-
- # Leaving a note for the sysadmin if the they proceed with the installation.
- fn="${PKG_INSTALL_ROOT}${obsolete_dir}/${obsolete_dir_file_name}"
- if touch "${fn}" 2>/dev/null; then
- echo "${obsolete_dir_information}" > "${fn}"
- fi
- fi
-done
-
-exit 0
Copied: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql5 (from rev 16832, csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql51)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql5 (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql5 2012-02-15 17:16:29 UTC (rev 17063)
@@ -0,0 +1,183 @@
+#!/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/mysql51/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 mysql51rc still remains in this startup script.
+#
+
+RETVAL=0
+MYSQLHOME=/opt/csw/mysql51
+MYSQL_VAR=/var/opt/csw/mysql51
+MYSQLD_DATADIR=$MYSQL_VAR
+MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
+CONFFILE=$MYSQL_VAR/my.cnf
+
+#
+# Source configuration
+[ -r /opt/csw/mysql51/etc/mysql51rc ] && . /opt/csw/mysql51/etc/mysql51rc
+[ -r /etc/opt/csw/mysql51rc ] && . /etc/opt/csw/mysql51rc
+
+# To get started quickly, copy a sample configuration file from
+# $MYSQLHOME/share/mysql
+# For example,
+# cp /opt/csw/mysql51/share/mysql/my-medium.cnf /opt/csw/mysql51/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 [ x"$CONFFILE" = x"$MYSQL_VAR/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_VAR/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
+ MYSQLD_DATADIR=
+fi
+
+# Make sure required vars are set
+MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_VAR/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/mysql51/share/mysql/quick_start-csw
+# if [ ! -d "$MYSQLHOME/var/mysql" ] ; then
+# echo MySQL core database has not been created.
+# echo Creating it now...
+# $MYSQLHOME/bin/mysql_install_db
+# chown -R mysql:mysql $MYSQLHOME/var
+# fi
+
+# 2006-04-16 --defaults-file is changed to --defaults-extra-file
+ $MYSQLHOME/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 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
+}
+
+case $1 in
+ start)
+ start_it
+ ;;
+
+ stop)
+ stop_it
+ ;;
+
+ restart)
+ stop_it
+ while pgrep mysqld > /dev/null
+ do
+ sleep 1
+ done
+ start_it
+ ;;
+
+ *)
+ echo "Usage: $0 { start | stop | restart } "
+ ;;
+esac
+
+exit $RETVAL
Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql51
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql51 2012-02-15 14:33:46 UTC (rev 17062)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x/files/cswmysql51 2012-02-15 17:16:29 UTC (rev 17063)
@@ -1,183 +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/mysql51/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 mysql51rc still remains in this startup script.
-#
-
-RETVAL=0
-MYSQLHOME=/opt/csw/mysql51
-MYSQL_VAR=/var/opt/csw/mysql51
-MYSQLD_DATADIR=$MYSQL_VAR
-MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
-CONFFILE=$MYSQL_VAR/my.cnf
-
-#
-# Source configuration
-[ -r /opt/csw/mysql51/etc/mysql51rc ] && . /opt/csw/mysql51/etc/mysql51rc
-[ -r /etc/opt/csw/mysql51rc ] && . /etc/opt/csw/mysql51rc
-
-# To get started quickly, copy a sample configuration file from
-# $MYSQLHOME/share/mysql
-# For example,
-# cp /opt/csw/mysql51/share/mysql/my-medium.cnf /opt/csw/mysql51/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 [ x"$CONFFILE" = x"$MYSQL_VAR/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_VAR/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
- MYSQLD_DATADIR=
-fi
-
-# Make sure required vars are set
-MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_VAR/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/mysql51/share/mysql/quick_start-csw
-# if [ ! -d "$MYSQLHOME/var/mysql" ] ; then
-# echo MySQL core database has not been created.
-# echo Creating it now...
-# $MYSQLHOME/bin/mysql_install_db
-# chown -R mysql:mysql $MYSQLHOME/var
-# fi
-
-# 2006-04-16 --defaults-file is changed to --defaults-extra-file
- $MYSQLHOME/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 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
-}
-
-case $1 in
- start)
- start_it
- ;;
-
- stop)
- stop_it
- ;;
-
- restart)
- stop_it
- while pgrep 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