Skip to content
Snippets Groups Projects
Commit a6583c15 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Revert emptying /etc/mysql/debian.cnf (Closes: #971256)

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.
parent f4b4ae61
No related branches found
No related tags found
No related merge requests found
......@@ -184,13 +184,27 @@ EOF
# And while it's not needed for new installations, we keep using
# --defaults-file option for tools (for the sake of upgrades)
# 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;
if [ ! -d "$mysql_cfgdir" ]; then
install -o 0 -g 0 -m 0755 -d $mysql_cfgdir
fi
if [ ! -e "$dc" ]; then
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
# Keep it only root-readable, as it always was
chown 0:0 $dc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment