Hello all, Maciej,
I've prepared some patches for the build recipe of MySQL 5.5. I've
tested them on my own system, they seem to work.
I've tried to make them easy to apply in that order from the mysql-5.5.x
directory, please tell me if I could do better.
They are:
01_: make gsed replace all occurrences of @xxx@ on a given line. I feel
it should be always like that, though it only impacts my patch 05_ so far;
02_: remove the automatic start of the service at the end of the
install. It should be handled by the CAS;
03_: minor fixes in the start scrip: fixes the default datadir, cosmetic
changes to the comments;
04_: replace the chkconfig bit of the comment by CAS information;
05_: that's a new feature: I've added a few lines to start MySQL in 32
or 64 bit automatically according to what the kernel supports (default),
or to a configuration value in csw.conf. This makes it much easier to
have an optimized MySQL running.
Comments, thoughts?
Laurent
Index: Makefile
===================================================================
--- Makefile (revision 19068)
+++ Makefile (working copy)
@@ -308,11 +308,11 @@
post-configure-modulated:
gsed \
- -e 's+@prefix@+$(prefix)+' \
- -e 's+@localstatedir@+$(localstatedir)+' \
- -e 's+@sysconfdir@+$(sysconfdir)+' \
- -e 's+@bindir@+$(bindir)+' \
- -e 's+@BASE_VERSION@+$(BASE_VERSION)+' \
+ -e 's+@prefix@+$(prefix)+g' \
+ -e 's+@localstatedir@+$(localstatedir)+g' \
+ -e 's+@sysconfdir@+$(sysconfdir)+g' \
+ -e 's+@bindir@+$(bindir)+g' \
+ -e 's+@BASE_VERSION@+$(BASE_VERSION)+g' \
< $(WORKDIR)/csw$(NAME).tpl \
> $(WORKDIR)/csw$(NAME)
@$(MAKECOOKIE)
Index: files/CSWmysql5.postinstall
===================================================================
--- files/CSWmysql5.postinstall (revision 19068)
+++ files/CSWmysql5.postinstall (working copy)
@@ -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
Index: files/cswmysql5.tpl
===================================================================
--- files/cswmysql5.tpl (revision 19068)
+++ files/cswmysql5.tpl (working copy)
@@ -27,11 +27,11 @@
# 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 +40,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.
@@ -69,7 +69,7 @@
bindir=@bindir@
if test -z "$datadir"
then
- datadir=@localstatedir@/mysql5
+ datadir=@localstatedir@
fi
sbindir=@prefix@/libexec
libexecdir=@prefix@/libexec
Index: files/cswmysql5.tpl
===================================================================
--- files/cswmysql5.tpl (revision 19068)
+++ files/cswmysql5.tpl (working copy)
@@ -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 @prefix@, then you
# have to do one of the following things for this script to work:
#
Index: files/cswmysql5.tpl
===================================================================
--- files/cswmysql5.tpl (revision 19068)
+++ files/cswmysql5.tpl (working copy)
@@ -200,6 +192,43 @@
fi
}
+### START OPENCSW ARCHITECTURE SELECTION
+# Source the configuration
+# This is used to define the binary architeture to run
+[ -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 +304,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
_______________________________________________
devel mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/devel