Skip to content
Permalink
Browse files
MDEV-14560 Extra engines enabled through additional config are not lo…
…aded on first installation

Solution for Debian/Ubuntu: install a trigger to restart mysqld
automatically whenever a package changes something in /etc/mysql
or in /etc/systemd/system/mariadb.service.d
  • Loading branch information
vuvova committed Jun 24, 2018
1 parent a19089f commit f25a5c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
@@ -50,14 +50,14 @@ EOF
return $retval
}

# This is necessary because mysql_install_db removes the pid file in /var/run
# and because changed configuration options should take effect immediately.
# In case the server wasn't running at all it should be ok if the stop
# script fails. I can't tell at this point because of the cleaned /var/run.
set +e; invoke stop; set -e

case "$1" in
configure)
# This is needed because mysql_install_db removes the pid file in /var/run
# and because changed configuration options should take effect immediately.
# In case the server wasn't running at all it should be ok if the stop
# script fails. I can't tell at this point because of the cleaned /var/run.
set +e; invoke stop; set -e

mysql_statedir=/usr/share/mysql
mysql_datadir=/var/lib/mysql
mysql_logdir=/var/log/mysql
@@ -91,7 +91,7 @@ case "$1" in
mv "$targetdir" "$mysql_tmp"
cat << EOF > "$mysql_tmp/README"
Ff you're reading this, it's most likely because you had replaced /var/lib/mysql
If you're reading this, it's most likely because you had replaced /var/lib/mysql
with a symlink, then upgraded to a new version of mysql, and then dpkg
removed your symlink (see #182747 and others). The mysql packages noticed
that this happened, and as a workaround have restored it. However, because
@@ -240,6 +240,13 @@ EOF
abort-upgrade|abort-remove|abort-configure)
;;

triggered)
if [ -x "$(command -v systemctl)" ]; then
systemctl daemon-reload
fi
invoke restart
;;

*)
echo "postinst called with unknown argument '$1'" 1>&2
exit 1
@@ -0,0 +1,2 @@
interest-noawait /etc/mysql
interest-noawait /etc/systemd/system/mariadb.service.d

0 comments on commit f25a5c3

Please sign in to comment.