[csw-devel] SF.net SVN: gar:[16937] csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Jan 31 00:01:39 CET 2012


Revision: 16937
          http://gar.svn.sourceforge.net/gar/?rev=16937&view=rev
Author:   wahwah
Date:     2012-01-30 23:01:39 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
mysql5/branches/mysql-5.5.x: backported changes from mysql-5.0

Modified Paths:
--------------
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/quick_start-csw

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl	2012-01-30 17:14:12 UTC (rev 16936)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl	2012-01-30 23:01:39 UTC (rev 16937)
@@ -26,6 +26,7 @@
 MYSQLD_DATADIR=$MYSQL_VAR
 MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
 CONFFILE=${sysconfdir}/my.cnf
+MYSQLD_PROG=${MYSQLD_PROG:-mysqld-${BASE_VERSION}}
 
 # Source the configuration
 [ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
@@ -78,12 +79,12 @@
 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."
+            echo "${MYSQLD_PROG} (`cat $MYSQLD_PID_FILE`) seems to be running."
             return 1
         fi
     fi
 
-    printf "%-60s" "Starting mysqld: "
+    printf "%-60s" "Starting ${MYSQLD_PROG}: "
 
     # 2006-03-11
     # This script no longer creates the default database. You may create the
@@ -192,7 +193,7 @@
 
     restart)
     stop_it
-    while pgrep `pgrep_opts` mysqld > /dev/null
+    while pgrep `pgrep_opts` ${MYSQLD_PROG} > /dev/null
       do
       sleep 1
     done

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/quick_start-csw
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/quick_start-csw	2012-01-30 17:14:12 UTC (rev 16936)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/quick_start-csw	2012-01-30 23:01:39 UTC (rev 16937)
@@ -8,10 +8,13 @@
 # This script creates a default database with the small-memory footprint.
 # Input may be provided for DATADIR and DEFAULTS_FILE
 #
-BASEDIR=/opt/csw/mysql51
-MYSQL_VAR=/var/opt/csw/mysql51
-DEFAULTS_FILE=$BASEDIR/my.cnf
-SAVE_DEFAULTS_FILE=$MYSQL_VAR/my.cnf
+# TODO: This file should be integrated with CSWmysql5.postinstall file.
+
+prefix=/opt/csw
+MYSQL_HOME=${prefix}
+MYSQL_VAR=/var${prefix}
+sysconfdir=/etc${prefix}
+DEFAULTS_FILE=${prefix}/support-files/my-small.cnf
 MYSQLD_USER=mysql
 #
 # Provide a default data directory
@@ -21,7 +24,7 @@
 echo  "This is the start script to setup a MySQL-5 database"
 echo  "  directory."
 echo
-echo  "  The base directory is $BASEDIR."
+echo  "  The base directory is $MYSQL_HOME."
 echo  "  The default database directory is $MYSQLD_DATADIR."
 echo
 echo  "  If you have not setup a partition for the database and"
@@ -51,7 +54,7 @@
     ` || exit $?
 if [ $usrin = "[default]" ]; then
     if [ ! -f "$DEFAULTS_FILE" ]; then
-        IN_DEFAULTS_FILE=$BASEDIR/share/mysql/my-small.cnf
+        IN_DEFAULTS_FILE=$MYSQL_HOME/support-files/my-small.cnf
         echo "Using $IN_DEFAULTS_FILE to create the options file."
     else
         IN_DEFAULTS_FILE=$DEFAULTS_FILE
@@ -102,10 +105,10 @@
 echo "Creating MySQL core database in $MYSQLD_DATADIR"
 echo
 echo "###  The following messages are from mysql_install_db."
-$BASEDIR/bin/mysql_install_db \
+$MYSQL_HOME/bin/mysql_install_db \
     --defaults-extra-file=$DEFAULTS_FILE \
     --user=$MYSQLD_USER \
-    --basedir=$BASEDIR \
+    --basedir=$MYSQL_HOME \
     --datadir=$MYSQLD_DATADIR
 
 #
@@ -115,7 +118,7 @@
 #
 # 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/mysql51|$MYSQLD_DATADIR|g" $DEFAULTS_FILE >$DEFAULTS_FILE.new
+    sed -e "s|/var/opt/csw|$MYSQLD_DATADIR|g" $DEFAULTS_FILE >$DEFAULTS_FILE.new
     mv $DEFAULTS_FILE.new $DEFAULTS_FILE
 fi
 
@@ -123,17 +126,17 @@
 # Ending message
 echo
 echo "###  The following messages are from quick_start-csw."
-echo "See /opt/csw/mysql51/share/mysql/doc/README.CSW for packaging changes."
+echo "See /opt/csw/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 CSWmysql51."
+echo "  for starting CSWmysql55."
 smf=no
 if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi
 if [ $smf = yes ]
 then
-    echo "To start mysqld; run \`svcadm enable cswmysql51\` on Solaris 10 or later"
+    echo "To start mysqld; run \`svcadm enable cswmysql55\` on Solaris 10 or later"
 else
-    echo "To start mysqld; run \`/etc/opt/csw/init.d/cswmysql51 start\` on Solaris 9 or earlier"
+    echo "To start mysqld; run \`/etc/opt/csw/init.d/cswmysql55 start\` on Solaris 9 or earlier"
 fi
 
 exit 0

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