[csw-devel] SF.net SVN: gar:[8936] csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Mar 2 11:14:39 CET 2010


Revision: 8936
          http://gar.svn.sourceforge.net/gar/?rev=8936&view=rev
Author:   wahwah
Date:     2010-03-02 10:14:39 +0000 (Tue, 02 Mar 2010)

Log Message:
-----------
mysql-5.1.x-optcsw: changes ported from mysql-5.0.x, added an override, cleaned up a few things.

Modified Paths:
--------------
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/Makefile
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/checksums

Added Paths:
-----------
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.postinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.preinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql51

Removed Paths:
-------------
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.postinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.preinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql5

Property Changed:
----------------
    csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/


Property changes on: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw
___________________________________________________________________
Modified: svn:externals
   - gar https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/v2-checkpkg

   + gar https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/gar/v2


Modified: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/Makefile	2010-03-02 09:46:30 UTC (rev 8935)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/Makefile	2010-03-02 10:14:39 UTC (rev 8936)
@@ -3,14 +3,14 @@
 # $Id$
 
 PROJ_NAME = mysql
-GARNAME = $(PROJ_NAME)5
+GARNAME = $(PROJ_NAME)51
 BASE_VERSION = 5.1
-PATCHLEVEL = 40
+PATCHLEVEL = 44
 GARVERSION = $(BASE_VERSION).$(PATCHLEVEL)
 CATEGORIES = server
 
 # Useful when making a series of builds on the same day
-GARFLAVOR ?= DBG
+# GARFLAVOR ?= DBG
 
 DISTNAME = mysql-$(GARVERSION)
 SPKG_SOURCEURL = http://www.mysql.com/
@@ -43,8 +43,12 @@
 
 INITSMF = $(global_sysconfdir)/init\.d/csw$(GARNAME)
 
-PACKAGES  = CSW$(GARNAME) CSW$(GARNAME)bench CSW$(GARNAME)client CSW$(GARNAME)devel
-PACKAGES += CSW$(GARNAME)rt CSW$(GARNAME)test
+PACKAGES  = CSW$(GARNAME)
+PACKAGES += CSW$(GARNAME)bench
+PACKAGES += CSW$(GARNAME)client
+PACKAGES += CSW$(GARNAME)devel
+PACKAGES += CSW$(GARNAME)rt
+PACKAGES += CSW$(GARNAME)test
 
 PATCHFILES  = 0001-Use-libc-not-libcrypt.patch
 PATCHFILES += 0002-cast-user_info-pw_gid-to-gid_t.patch
@@ -66,7 +70,7 @@
 CATALOGNAME_CSW$(GARNAME)test   = $(GARNAME)test
 
 
-ARCHALL_CSWmysql5bench = 1
+ARCHALL_CSW$(GARNAME)bench = 1
 
 # Defining the client programs, which are going to pick up the 32- and 64-bit
 # binaries, symbolic links, isaexec stuff and man pages.
@@ -132,7 +136,7 @@
 RUNTIME_DEP_PKGS_CSW$(GARNAME)client     += CSWosslrt
 RUNTIME_DEP_PKGS_CSW$(GARNAME)client     += CSWncurses
 RUNTIME_DEP_PKGS_CSW$(GARNAME)client     += CSWzlib
-RUNTIME_DEP_PKGS_CSW$(GARNAME)devel       = CSW$(GARNAME)
+RUNTIME_DEP_PKGS_CSW$(GARNAME)devel       = CSW$(GARNAME)rt
 RUNTIME_DEP_PKGS_CSW$(GARNAME)test        = CSW$(GARNAME)
 RUNTIME_DEP_PKGS_CSW$(GARNAME)test       += CSWperl
 
@@ -196,12 +200,12 @@
 PROTOTYPE_PERMS_dbdir = 0700
 PROTOTYPE_CLASS_dbdir = ugfiles
 
-SPKG_CLASSES = none ugfiles
-
 include gar/category.mk
 
 CFLAGS := $(filter-out -I%,$(CFLAGS))
 
+CHECKPKG_OVERRIDES_CSWmysql51devel += missing-dependency|CSWmysql51
+
 test-custom:
 	alias sh=/usr/bin/bash;                                 \
 		cd $(WORKSRC)/mysql-test;                       \
@@ -223,20 +227,22 @@
 	ginstall -m 644 $(FILEDIR)/ChangeLog $(PKGROOT)$(datadir)/mysql/doc
 	ginstall -m 644 $(FILEDIR)/README.CSW $(PKGROOT)$(datadir)/mysql/doc
 	ginstall -m 755 -d $(PKGROOT)/opt/csw/share/mysql/doc
-	# ln -sf ../../../mysql5/share/mysql/doc/README.CSW \
-	# 	$(PKGROOT)/opt/csw/share/mysql/doc/README.CSW
+	ln -sf ../../../$(GARNAME)/share/mysql/doc/README.CSW \
+		$(PKGROOT)/opt/csw/share/mysql/doc/README.CSW
 	ginstall -m 755 -d $(PKGROOT)/etc/opt/csw/init.d
 	ginstall -m 755 $(FILEDIR)/csw$(GARNAME) $(PKGROOT)/etc/opt/csw/init.d
 	ginstall -m 755 $(FILEDIR)/quick_start-csw $(PKGROOT)$(datadir)/mysql
 	ginstall -m 755 -d $(PKGROOT)$(global_sysconfdir)/pkg/CSW$(GARNAME)
 	ginstall -m 644 $(FILEDIR)/cswusergroup \
 		        $(PKGROOT)$(global_sysconfdir)/pkg/CSW$(GARNAME)
-	## A symlink for mysql5 include files
-	## ginstall -m 755 -d $(PKGROOT)/opt/csw/include
-	## ln -s ../mysql5/include/mysql $(PKGROOT)/opt/csw/include/mysql
+	# A symlink for mysql5 include files
+	# ginstall -m 755 -d $(PKGROOT)/opt/csw/include
+	# ln -s ../$(GARNAME)/include/mysql $(PKGROOT)/opt/csw/include/mysql
 	# Create symlinks to binaries
 	ginstall -m 755 -d $(PKGROOT)$(global_bindir)
 	for f in $(PKGROOT)$(bindir)/*; do \
+		if echo $$f | grep amd64$$; then continue; fi; \
+		if echo $$f | grep sparcv9$$; then continue; fi; \
 		ln -s ../..$(bindir)/`basename $$f` \
 		      $(PKGROOT)$(global_bindir)/`basename $$f`; \
 	done

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/checksums
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/checksums	2010-03-02 09:46:30 UTC (rev 8935)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/checksums	2010-03-02 10:14:39 UTC (rev 8936)
@@ -2,11 +2,11 @@
 1414d06fab1530484a508927a0de4154  0002-cast-user_info-pw_gid-to-gid_t.patch
 5415f365f1b0f7a179d1efc25f45bbee  0003-OpenCSW-perl-for-tests.patch
 8ab232cd4d232b3cda3bbced93f80237  0004-basedir-and-datadir-in-the-cnf-files.patch
-747637bc4be42207974ae845d832ae65  CSWmysql5.postinstall
-60162ea667507a6a487027e7c389ca55  CSWmysql5.preinstall
+feef62c3234b1e054ec4d06290b8b43d  CSWmysql51.postinstall
+a652ccff001c328178f4b0ed9bfebbd6  CSWmysql51.preinstall
 e691b0cf00a3925ac55c1844045d6e30  ChangeLog
 e42afb5ec1b1ab02d2ec3b46d0922636  README.CSW
-aaca748fc044834e71ad544ab293c494  cswmysql5
+0974c28c048437612c6a0ace93460d3b  cswmysql51
 67228e1f096fe08a94f4267439a4ec36  cswusergroup
-32e7373c16271606007374396e6742ad  mysql-5.1.40.tar.gz
+a16fa6d6c7f40a963919cbc1c5e86111  mysql-5.1.44.tar.gz
 90b7cfcd11ab56e021a195a6a085fa21  quick_start-csw

Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.postinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.postinstall	2010-03-02 09:46:30 UTC (rev 8935)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.postinstall	2010-03-02 10:14:39 UTC (rev 8936)
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-MYSQLDATADIR=/var/opt/csw/mysql5
-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-optcsw/files/CSWmysql5.preinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.preinstall	2010-03-02 09:46:30 UTC (rev 8935)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.preinstall	2010-03-02 10:14:39 UTC (rev 8936)
@@ -1,40 +0,0 @@
-#!/bin/sh
-# vim:set sw=2 ts=2 sts=2 expandtab:
-#
-# $Id$
-#
-
-obsolete_directories="/opt/csw/mysql5/var:/var/opt/csw/mysql5"
-
-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-optcsw/files/CSWmysql51.postinstall (from rev 7856, csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.postinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.postinstall	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.postinstall	2010-03-02 10:14:39 UTC (rev 8936)
@@ -0,0 +1,95 @@
+#!/bin/ksh -p
+#
+# $Id$
+#
+# initial version for blastwave.org by Alex Moore 2006.02.25
+# Revised 2006.03.25 - see bug report 0001542
+#
+# This script creates a default database with the small-memory footprint.
+# Input may be provided for DATADIR and DEFAULTS_FILE
+#
+BASEDIR=/opt/csw
+MYSQL_VAR=/var/opt/csw/mysql/@MYSQL_BASE_VERSION@
+DEFAULTS_FILE=$BASEDIR/my.cnf
+SAVE_DEFAULTS_FILE=$MYSQL_VAR/my.cnf
+MYSQLD_USER=mysql
+# Provide the default data directory
+MYSQLD_DATADIR=$MYSQL_VAR
+
+# http://bugs.mysql.com/bug.php?id=31164
+# ERROR: 1004  Can't create file '/var/tmp//installRJaiQ3/#sql6fee_1_0.frm' (errno: 13)
+unset TMPDIR
+
+if [ ! -f "$DEFAULTS_FILE" ]; then
+    IN_DEFAULTS_FILE=$BASEDIR/share/mysql/my-small.cnf
+    echo "Using $IN_DEFAULTS_FILE to create the options file."
+else
+    IN_DEFAULTS_FILE=$DEFAULTS_FILE
+    echo "Using $DEFAULTS_FILE as the options file."
+fi
+
+if [ -d "$MYSQLD_DATADIR/mysql" ]; then
+    echo "mysql database already exists."
+    echo "Leaving script without initializing a database."
+    exit 0
+fi
+
+echo  "Setting up the database"
+# Create the database directory and set the permissions if needed
+if [ ! -d "$MYSQLD_DATADIR" ] ; then
+    mkdir -p $MYSQLD_DATADIR
+    chown -R mysql:mysql $MYSQLD_DATADIR
+    chmod 0700 $MYSQLD_DATADIR
+fi
+#
+# copy the configuration file if not exists.
+CNFCOPIED=no
+if [ ! -f "$DEFAULTS_FILE" ] ; then
+    cp -p $IN_DEFAULTS_FILE $DEFAULTS_FILE
+    CNFCOPIED=yes
+fi
+#
+# Run the mysql script to create the database
+echo "Creating MySQL core database in $MYSQLD_DATADIR"
+echo
+echo "###  The following messages are from mysql_install_db."
+$BASEDIR/bin/mysql_install_db \
+    --defaults-extra-file="$DEFAULTS_FILE" \
+    --user="$MYSQLD_USER" \
+    --basedir="$BASEDIR" \
+    --datadir="$MYSQLD_DATADIR"
+
+# Fix permissions on the data directory, since mysql_install_db was run as
+# root.
+chown -R mysql:mysql $MYSQLD_DATADIR
+
+# Update --datadir in the cnf file with the correct value if file was copied
+if [ x"$CNFCOPIED" = xyes ]; then
+    sed -e "s|/var/opt/csw/mysql5|$MYSQLD_DATADIR|g" $DEFAULTS_FILE >$DEFAULTS_FILE.new
+    mv $DEFAULTS_FILE.new $DEFAULTS_FILE
+fi
+
+# Ending message
+echo
+echo "###  The following messages are from $0."
+echo "See /opt/csw/mysql5/share/mysql/doc/README.CSW for packaging changes."
+echo "Please ignore references to starting mysqld_safe in the messages above."
+echo "  These messages are from mysql_install_db.  See the following"
+echo "  for starting CSWmysql5."
+smf=no
+if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi
+if [ $smf = yes ]
+then
+	echo "Running \`svcadm enable cswmysql5\` start to start the database."
+  # First, we clear the status, since it's likely to be 'maintenance'.
+  svcadm disable cswmysql5
+  svcadm clear cswmysql5
+  svcadm enable cswmysql5
+else
+  echo "Running \`/etc/opt/csw/init.d/cswmysql\` start to start the database."
+  /etc/opt/csw/init.d/cswmysql start
+fi
+
+exit 0
+
+# vim:set ts=2 sw=2 sts=2 expandtab:

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.preinstall (from rev 7856, csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql5.preinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.preinstall	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/CSWmysql51.preinstall	2010-03-02 10:14:39 UTC (rev 8936)
@@ -0,0 +1,40 @@
+#!/bin/sh
+# vim:set sw=2 ts=2 sts=2 expandtab:
+#
+# $Id$
+#
+
+obsolete_directories="/opt/csw/mysql5/var:/var/opt/csw/mysql5"
+
+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-optcsw/files/cswmysql5
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql5	2010-03-02 09:46:30 UTC (rev 8935)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql5	2010-03-02 10:14:39 UTC (rev 8936)
@@ -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/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
-MYSQLHOME=/opt/csw/mysql5
-MYSQL_VAR=/var/opt/csw/mysql5
-MYSQLD_DATADIR=$MYSQL_VAR
-MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
-CONFFILE=$MYSQL_VAR/my.cnf
-
-#
-# Source configuration
-[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
-[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
-
-# To get started quickly, copy a sample configuration file from
-#   $MYSQLHOME/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 [ 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/mysql5/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

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql51 (from rev 8927, csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql5)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql51	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/cswmysql51	2010-03-02 10:14:39 UTC (rev 8936)
@@ -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/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
+MYSQLHOME=/opt/csw/mysql5
+MYSQL_VAR=/var/opt/csw/mysql5
+MYSQLD_DATADIR=$MYSQL_VAR
+MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
+CONFFILE=$MYSQL_VAR/my.cnf
+
+#
+# Source configuration
+[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
+[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
+
+# To get started quickly, copy a sample configuration file from
+#   $MYSQLHOME/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 [ 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/mysql5/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