revno: 463.1.1 [merge]
fixes bug: https://launchpad.net/bugs/710799
committer: Alexey Bychko <email address hidden>
branch nick: bug710799-5.5
timestamp: Thu 2013-03-07 19:45:40 +0700
message:
fix for bug 710799, version 5.5
[-] disabled uncongitional manual creation of /var/lib/mysql/*
[+] added conditional call of mysql_install_db, only for clean installation, but not for upgrade
[+] added debug possibility for %post
diff:
=== modified file 'build/percona-server.spec'
--- build/percona-server.spec 2013-02-26 16:40:25 +0000
+++ build/percona-server.spec 2013-03-07 12:45:40 +0000
@@ -710,13 +710,16 @@
fi
%post -n Percona-Server-server%{product_suffix}
-
+if [ X${PERCONA_DEBUG} == X1 ]; then
+ set -x
+fi
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
+if [ $1 -eq 1 ]; then
# ----------------------------------------------------------------------
# Create data directory if needed, check whether upgrade or install
# ----------------------------------------------------------------------
@@ -734,8 +737,11 @@
# If the directory exists, we may assume it is an upgrade.
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
fi
-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
+if [ ! -d $mysql_datadir/test ]; then
+ mkdir $mysql_datadir/test;
+fi
+%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+fi
# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
# ----------------------------------------------------------------------
@@ -761,26 +767,19 @@
usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# ----------------------------------------------------------------------
+# Initiate databases if needed
+# ----------------------------------------------------------------------
+# ----------------------------------------------------------------------
+# Upgrade databases if needed would go here - but it cannot be automated yet
+# ----------------------------------------------------------------------
+
+# ----------------------------------------------------------------------
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
# ----------------------------------------------------------------------
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# ----------------------------------------------------------------------
-# Initiate databases if needed
-# ----------------------------------------------------------------------
-
-# ----------------------------------------------------------------------
-# Upgrade databases if needed would go here - but it cannot be automated yet
-# ----------------------------------------------------------------------
-
-# ----------------------------------------------------------------------
-# Change permissions again to fix any new files.
-# ----------------------------------------------------------------------
-chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
-
-# ----------------------------------------------------------------------
# Fix permissions for the permission database so that only the user
# can read them.
# ---------------------------------------------------------------------- ------------------------------------------------------------
Possible regression from:
revno: 463.1.1 [merge] /launchpad. net/bugs/ 710799 percona- server. spec' server. spec 2013-02-26 16:40:25 +0000 server. spec 2013-03-07 12:45:40 +0000
fixes bug: https:/
committer: Alexey Bychko <email address hidden>
branch nick: bug710799-5.5
timestamp: Thu 2013-03-07 19:45:40 +0700
message:
fix for bug 710799, version 5.5
[-] disabled uncongitional manual creation of /var/lib/mysql/*
[+] added conditional call of mysql_install_db, only for clean installation, but not for upgrade
[+] added debug possibility for %post
diff:
=== modified file 'build/
--- build/percona-
+++ build/percona-
@@ -710,13 +710,16 @@
fi
%post -n Percona- Server- server% {product_ suffix}
-
+if [ X${PERCONA_DEBUG} == X1 ]; then
+ set -x
+fi
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
mysql_ datadir= %{mysqldatadir} VERSION= %{mysql_ version} -%{release} FILE=$mysql_ datadir/ RPM_UPGRADE_ MARKER
NEW_
STATUS_
+if [ $1 -eq 1 ]; then ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- datadir/ test; fi datadir/ test; {_bindir} /mysql_ install_ db --rpm --user= %{mysqld_ user} ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
# -------
# Create data directory if needed, check whether upgrade or install
# -------
@@ -734,8 +737,11 @@
# If the directory exists, we may assume it is an upgrade.
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
fi
-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_
+if [ ! -d $mysql_datadir/test ]; then
+ mkdir $mysql_
+fi
+%
+fi
# -------
# Make MySQL start/shutdown automatically when the machine does it.
# -------
@@ -761,26 +767,19 @@
usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- user}:% {mysqld_ group} $mysql_datadir
+# Initiate databases if needed
+# -------
+# -------
+# Upgrade databases if needed would go here - but it cannot be automated yet
+# -------
+
+# -------
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
# -------
chown -R %{mysqld_
# ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- user}:% {mysqld_ group} $mysql_datadir ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
----- ------- ------- ------- ------- ------- ------- ------- ------
-# Initiate databases if needed
-# -------
-
-# -------
-# Upgrade databases if needed would go here - but it cannot be automated yet
-# -------
-
-# -------
-# Change permissions again to fix any new files.
-# -------
-chown -R %{mysqld_
-
-# -------
# Fix permissions for the permission database so that only the user
# can read them.
# -------
which was fix for https:/ /bugs.launchpad .net/percona- server/ +bug/710799