Commit fa9bd073 authored by Otto Kekäläinen's avatar Otto Kekäläinen Committed by Otto Kekäläinen

Deb: Revert emptying /etc/mysql/debian.cnf on upgrades

Keep the user and password definitions as e.g. dbconfig-common expects to
find them there. Extend the file to document (in context) why it is about
to be obsoleted to facilitate users migrating away from it.

Upstreamed from https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/a6583c15226ad9a0ca37861e1bd01057bcff32a5
parent af8fa245
...@@ -185,13 +185,27 @@ EOF ...@@ -185,13 +185,27 @@ EOF
# And while it's not needed for new installations, we keep using # And while it's not needed for new installations, we keep using
# --defaults-file option for tools (for the sake of upgrades) # --defaults-file option for tools (for the sake of upgrades)
# and thus need /etc/mysql/debian.cnf to exist, even if it's empty. # and thus need /etc/mysql/debian.cnf to exist, even if it's empty.
# In the long run the goal is to obsolete this file.
dc=$mysql_cfgdir/debian.cnf; dc=$mysql_cfgdir/debian.cnf;
if [ ! -d "$mysql_cfgdir" ]; then if [ ! -d "$mysql_cfgdir" ]; then
install -o 0 -g 0 -m 0755 -d $mysql_cfgdir install -o 0 -g 0 -m 0755 -d $mysql_cfgdir
fi fi
if [ ! -e "$dc" ]; then if [ ! -e "$dc" ]; then
cat /dev/null > $dc cat /dev/null > $dc
echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE." >>$dc
echo "# This file exists only for backwards compatibility for" >>$dc
echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'" >>$dc
echo "# and have root level access to the local filesystem." >>$dc
echo "# With those permissions one can run 'mariadb' directly" >>$dc
echo "# anyway thanks to unix socket authentication and hence" >>$dc
echo "# this file is useless. See package README for more info." >>$dc
echo "[client]" >>$dc
echo "host = localhost" >>$dc
echo "user = root" >>$dc
echo "[mysql_upgrade]" >>$dc
echo "host = localhost" >>$dc
echo "user = root" >>$dc
echo "# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." >>$dc
fi fi
# Keep it only root-readable, as it always was # Keep it only root-readable, as it always was
chown 0:0 $dc chown 0:0 $dc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment