summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurthy Narkedimilli <murthy.narkedimilli@oracle.com>2013-05-16 17:33:32 +0200
committerMurthy Narkedimilli <murthy.narkedimilli@oracle.com>2013-05-16 17:33:32 +0200
commit4f5c10e6b565bc2761b9d083e25c6a36141552a0 (patch)
treec2e214477e1c508b05801214b7925e86156e2c0a
parent0e5b0d503ea25204b61a6780b499f96f45eb6057 (diff)
downloadmariadb-git-4f5c10e6b565bc2761b9d083e25c6a36141552a0.tar.gz
Fix for BUG# 16812255: Removing the --random-password option
which is supported only for MYSQL server versions 5.6 and above.
-rw-r--r--packaging/rpm-uln/mysql.spec.sh2
-rw-r--r--packaging/solaris/CMakeLists.txt2
-rw-r--r--packaging/solaris/postinstall-solaris.sh (renamed from packaging/solaris/postinstall_check.sh)60
3 files changed, 58 insertions, 6 deletions
diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh
index 62f652ab586..233e4bae194 100644
--- a/packaging/rpm-uln/mysql.spec.sh
+++ b/packaging/rpm-uln/mysql.spec.sh
@@ -662,7 +662,7 @@ rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/postinstall
rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-*.spec
rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/mysql-log-rotate
rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/ChangeLog
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/solaris/postinstall_check
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/mysql/solaris/postinstall-solaris
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-stress-test.pl.1*
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-test-run.pl.1*
diff --git a/packaging/solaris/CMakeLists.txt b/packaging/solaris/CMakeLists.txt
index 6add0d81950..02881e0af8f 100644
--- a/packaging/solaris/CMakeLists.txt
+++ b/packaging/solaris/CMakeLists.txt
@@ -22,7 +22,7 @@
# It is important not to pollute "/usr/bin".
SET(inst_location ${INSTALL_SUPPORTFILESDIR})
-FOREACH(script postinstall_check)
+FOREACH(script postinstall-solaris)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh
${CMAKE_CURRENT_BINARY_DIR}/${script} COPYONLY )
diff --git a/packaging/solaris/postinstall_check.sh b/packaging/solaris/postinstall-solaris.sh
index e61c670c384..fcc980cd13e 100644
--- a/packaging/solaris/postinstall_check.sh
+++ b/packaging/solaris/postinstall-solaris.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,8 +43,7 @@ mystart=/etc/init.d/mysql
# Check: Is this a first installation, or an upgrade ?
if [ -d "$mydatadir/mysql" ] ; then
- # If the directory for system table files exists, we assume an upgrade.
- INSTALL=upgrade
+ : # If the directory for system table files exists, we assume an upgrade.
else
INSTALL=new # This is a new installation, the directory will soon be created.
fi
@@ -59,7 +58,28 @@ fi
chown -R $myuser:$mygroup $mydatadir
-if [ "$INSTALL" -eq "new" ] ; then
+# Solaris patch 119255 (somewhere around revision 42) changes the behaviour
+# of pkgadd to set TMPDIR internally to a root-owned install directory. This
+# has the unfortunate side effect of breaking running mysql_install_db with
+# the --user=mysql argument as mysqld uses TMPDIR if set, and is unable to
+# write temporary tables to that directory. To work around this issue, we
+# create a subdirectory inside TMPDIR (if set) for mysqld to write to.
+#
+# Idea from Ben Hekster <heksterb@gmail.com> in bug#31164
+
+if [ -n "$TMPDIR" ] ; then
+ savetmpdir="$TMPDIR"
+ TMPDIR="$TMPDIR/mysql.$$"
+ export TMPDIR
+ mkdir "$TMPDIR"
+ chown $myuser:$mygroup "$TMPDIR"
+fi
+
+
+# BUG# 16812255: Removing the option --random-passwords
+# as this is supported only for MYSQL releases 5.6 and above.
+
+if [ -n "$INSTALL" ] ; then
# We install/update the system tables
(
cd "$mybasedir"
@@ -71,5 +91,37 @@ if [ "$INSTALL" -eq "new" ] ; then
)
fi
+if [ -n "$savetmpdir" ] ; then
+ TMPDIR="$savetmpdir"
+fi
+
+# ----------------------------------------------------------------------
+
+# Handle situation there is old start script installed already
+
+# If old start script is a soft link, we just remove it
+[ -h "$mystart" ] && rm -f "$mystart"
+
+# If old start script is a file, we rename it
+[ -f "$mystart" ] && mv -f "$mystart" "$mystart.old.$$"
+
+# ----------------------------------------------------------------------
+
+# We create a copy of an unmodified start script,
+# as a reference for the one maybe modifying it
+
+cp -f "$mystart1.in" "$mystart.in" || exit 1
+
+# We rewrite some scripts
+
+for script in "$mystart" "$mystart1" "$myinstdb" ; do
+ script_in="$script.in"
+ sed -e "s,@basedir@,$mybasedir,g" \
+ -e "s,@datadir@,$mydatadir,g" "$script_in" > "$script"
+ chmod u+x $script
+done
+
+rm -f "$mystart.in"
+
exit 0