From ad47353914f40ea689acbeaa286802e2befbbdc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Thu, 4 Nov 2021 22:07:43 -0700 Subject: [PATCH] MDEV-26850: Never delete my.cnf, always use update-alternatives instead In Debian the file /etc/my.cnf is supposed to point to mariadb.cnf. This symlink is created and maintained by update-alternatives as run from mysql-common (the real Debian package) or a tweaked version of mariadb-common from mariadb.org repositories. Do not just bluntly replace it with a link during upgrades. This fixes a regression introduced in 07d1c8567cbfe which lacks a commit message explaining why this file was added in the first place. --- debian/mariadb-common.postinst | 17 +++++++++++++++-- debian/mysql-common.links | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 debian/mysql-common.links diff --git a/debian/mariadb-common.postinst b/debian/mariadb-common.postinst index 12f65bd3d9257..8ae2300460e0f 100644 --- a/debian/mariadb-common.postinst +++ b/debian/mariadb-common.postinst @@ -4,8 +4,21 @@ set -e case "$1" in configure) - # New packaging paradigm for my.cnf handling among MySQL variants - # Used in Ubuntu since Dec-2014 and in Debian since Jul-2015 + # A new packaging paradigm for my.cnf handling among MySQL variants using + # has been in Ubuntu since Dec-2014 and in Debian since Jul-2015. It uses + # source package 'mysql-defaults' + # (https://tracker.debian.org/pkg/mysql-defaults) + # + # This source package generates multiple 'default-mysql-*' packages that in + # Debian refer to MariaDB and in Ubuntu to MySQL. + # + # The source package also generates 'mysql-common', which owns the + # /etc/mysql configuration directory and which is responsible for among + # others symlinking my.cnf -> mariadb.conf + # + # See sources of mysql-common at + # https://salsa.debian.org/mariadb-team/mysql/-/tree/mysql-defaults/debian/master/debian + # to see how it works in detail. # # If the new mysql-common package does not provide # the update-alternatives facility, notify user about manual fall back diff --git a/debian/mysql-common.links b/debian/mysql-common.links deleted file mode 100644 index 5c45a67e4fc10..0000000000000 --- a/debian/mysql-common.links +++ /dev/null @@ -1 +0,0 @@ -etc/mysql/mariadb.cnf etc/mysql/my.cnf