[csw-devel] SF.net SVN: gar:[19161] csw/mgar/pkg/mysql5/branches/mysql-5.5.x
wilbury at users.sourceforge.net
wilbury at users.sourceforge.net
Thu Sep 6 16:32:06 CEST 2012
Revision: 19161
http://gar.svn.sourceforge.net/gar/?rev=19161&view=rev
Author: wilbury
Date: 2012-09-06 14:32:06 +0000 (Thu, 06 Sep 2012)
Log Message:
-----------
Polish postinstall and cswmysql5 template as well. Patches from Laurent Blume.
Modified Paths:
--------------
csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile
csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql5.postinstall
csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql5.tpl
Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile 2012-09-06 13:37:38 UTC (rev 19160)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile 2012-09-06 14:32:06 UTC (rev 19161)
@@ -308,11 +308,11 @@
post-configure-modulated:
gsed \
- -e 's+ at prefix@+$(prefix)+' \
- -e 's+ at localstatedir@+$(localstatedir)+' \
- -e 's+ at sysconfdir@+$(sysconfdir)+' \
- -e 's+ at bindir@+$(bindir)+' \
- -e 's+ at BASE_VERSION@+$(BASE_VERSION)+' \
+ -e 's+ at prefix@+$(prefix)+g' \
+ -e 's+ at localstatedir@+$(localstatedir)+g' \
+ -e 's+ at sysconfdir@+$(sysconfdir)+g' \
+ -e 's+ at bindir@+$(bindir)+g' \
+ -e 's+ at BASE_VERSION@+$(BASE_VERSION)+g' \
< $(WORKDIR)/csw$(NAME).tpl \
> $(WORKDIR)/csw$(NAME)
@$(MAKECOOKIE)
Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql5.postinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql5.postinstall 2012-09-06 13:37:38 UTC (rev 19160)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql5.postinstall 2012-09-06 14:32:06 UTC (rev 19161)
@@ -87,19 +87,6 @@
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
Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql5.tpl
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql5.tpl 2012-09-06 13:37:38 UTC (rev 19160)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql5.tpl 2012-09-06 14:32:06 UTC (rev 19161)
@@ -11,27 +11,19 @@
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
-# Comments to support chkconfig on RedHat Linux
-# chkconfig: 2345 64 36
-# description: A very fast and reliable SQL database engine.
+# Comments for OpenCSW's CAS scripts
+#RC_KNUM 01
+#RC_SNUM 99
+#RC_KLEV 0,1,2,S
+#RC_SLEV 3
+#FMRI network
+#AUTOENABLE no
-# Comments to support LSB init script conventions
-### BEGIN INIT INFO
-# Provides: mysql
-# Required-Start: $local_fs $network $remote_fs
-# Should-Start: ypbind nscd ldap ntpd xntpd
-# Required-Stop: $local_fs $network $remote_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: start and stop MySQL
-# Description: MySQL is a very fast and reliable SQL database engine.
-### END INIT INFO
-
-# If you install MySQL on some other places than /opt/mysql-5.5.19, then you
+# If you install MySQL on some other places than @prefix@, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
-# - Create a /etc/my.cnf file with the following information:
+# - Create a @sysconfdir@/my.cnf file with the following information:
# [mysqld]
# basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
@@ -40,7 +32,7 @@
# below.
#
# If you want to affect other MySQL variables, you should make your changes
-# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
+# in the @sysconfdir@/my.cnf, ~/.my.cnf or other MySQL configuration files.
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
@@ -200,6 +192,48 @@
fi
}
+### START OPENCSW ARCHITECTURE SELECTION
+# Source the configuration
+# This is used to define the binary architeture to run
+
+# Check the old location first
+[ -r @prefix@/etc/csw.conf ] && . @prefix@/etc/csw.conf
+
+# Check the current location, its content overrides the previous one
+[ -r @sysconfdir@/csw.conf ] && . @sysconfdir@/csw.conf
+
+# If the package-specific variable is not set, try the default
+if [ -z "$mysql5_arch" ]; then
+ if [ -n "$default_arch" ]; then
+ mysql5_arch="$default_arch"
+ fi
+else
+ # In that specific case, by default, there is no subdir
+ if [ "$mysql5_arch" = "i386" -o "$mysql5_arch" = "sparc" ]; then
+ mysql5_arch=""
+ fi
+fi
+
+# If a value was found
+if [ -n "$mysql5_arch" ]; then
+ if [ "$mysql5_arch" = "kernel" ]; then
+ # Use the system's default arch
+ mysql5_arch=`isainfo -k`
+ fi
+
+ # Add the architecture suffix to the executables' directories, if it exists
+ # The binaries themselves are tested below, so the script should fail
+ # mostly gracefully if a non-present arch is set up.
+ if [ -d "$bindir/$mysql5_arch" -a \
+ + -d "$sbindir/$mysql5_arch" -a \
+ + -d "$libexecdir/$mysql5_arch" ]; then
+ bindir="$bindir/$mysql5_arch"
+ sbindir="$sbindir/$mysql5_arch"
+ libexecdir="$libexecdir/$mysql5_arch"
+ fi
+fi
+### END OPENCSW ARCHITECTURE SELECTION
+
# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
if test -x ./bin/my_print_defaults
@@ -275,7 +309,9 @@
# Start daemon
# Safeguard (relative paths, core dumps..)
- cd $basedir
+ # Changed to /opt for OpenCSW to avoid mysqld_safe picking the 32 bit
+ # binary in libexec/
+ cd /opt
echo $echo_n "Starting MySQL"
if test -x $bindir/mysqld_safe
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