summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-11-05 13:57:24 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-11-05 13:57:24 +0400
commit178cddd664cb4ce2c6ccbe76c33e4fd2c1fc1b3d (patch)
tree85e6a3a96d48b72678ec7a38528f590f182fb227
parent2ef562d2c74297b0b92c4322697dad98767cc873 (diff)
downloadmariadb-git-bb-10.1-mdev8437.tar.gz
MDEV-9082 - Debian: mysql_install_db is called on upgradebb-10.1-mdev8437
A comment in debian/mariadb-server-10.1.postinst says: "can safely run on upgrades with existing databases". While this is true there're a few reasons not to do that: - it increases installation time (it has to run rather heavy mysqld multiple times) - as well as it increases mysqld downtime - it may fail if database has some plugin specific configs (see MDEV-8437) - there should be no need to run this script on upgrade: they should be handled by mysql_upgrade to - RPM postin doesn't call it if database directory exists Also postinst is not supposed to create database directories: let mysql_install_db do that intead.
-rw-r--r--debian/mariadb-server-10.1.postinst16
1 files changed, 4 insertions, 12 deletions
diff --git a/debian/mariadb-server-10.1.postinst b/debian/mariadb-server-10.1.postinst
index 40492a296ca..0f35802a884 100644
--- a/debian/mariadb-server-10.1.postinst
+++ b/debian/mariadb-server-10.1.postinst
@@ -104,8 +104,10 @@ EOF
# Ensure the existence and right permissions for the database and
# log files.
- if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi
- if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi
+ if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then
+ # Debian: beware of the bashisms...
+ /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql --disable-log-bin 2>&1 | $ERR_LOGGER
+ fi
if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi
# When creating an ext3 jounal on an already mounted filesystem like e.g.
# /var/lib/mysql, you get a .journal file that is not modifyable by chown.
@@ -130,16 +132,6 @@ EOF
# To avoid downgrades.
touch $mysql_statedir/debian-10.1.flag
-
- # initiate databases. Output is not allowed by debconf :-(
- # This will fail if we are upgrading an existing database; in this case
- # mysql_upgrade, called from the /etc/init.d/mysql start script, will
- # handle things.
- # Debian: beware of the bashisms...
- # Debian: can safely run on upgrades with existing databases
- set +e
- /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql --disable-log-bin 2>&1 | $ERR_LOGGER
- set -e
## On every reconfiguration the maintenance user is recreated.
#