Deb: Fix upgrade from Percona.com by ensuring server uses mariadb.cnf

Upstreamed from 13e3a7903e
This commit is contained in:
Otto Kekäläinen 2020-12-20 23:13:50 +02:00
parent ea56841997
commit a3448b2395

View file

@ -23,6 +23,18 @@ case "$1" in
echo " ln -sf mariadb.cnf /etc/mysql/my.cnf"
fi
fi
# Note that MySQL in Debian runs the configure-symlinks from the
# mysql-server-x.x.postinst and postrm files, while the MySQL.com (and
# Percona.com) packaging triggers update-alternatives directly form the
# mysql-common (and percona-x-common) package using priority 200.
#
# Thus, we need to ensure here that mariadb.cnf indeed became the primary
# alternative and override with priority 500 if needed.
if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf"
then
update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true
fi
;;
esac