Skip to content

Commit fa9bd07

Browse files
committed
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
1 parent af8fa24 commit fa9bd07

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

debian/mariadb-server-10.5.postinst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,27 @@ EOF
185185
# And while it's not needed for new installations, we keep using
186186
# --defaults-file option for tools (for the sake of upgrades)
187187
# and thus need /etc/mysql/debian.cnf to exist, even if it's empty.
188+
# In the long run the goal is to obsolete this file.
188189
dc=$mysql_cfgdir/debian.cnf;
189190
if [ ! -d "$mysql_cfgdir" ]; then
190191
install -o 0 -g 0 -m 0755 -d $mysql_cfgdir
191192
fi
192193
if [ ! -e "$dc" ]; then
193194
cat /dev/null > $dc
194-
echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
195+
echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE." >>$dc
196+
echo "# This file exists only for backwards compatibility for" >>$dc
197+
echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'" >>$dc
198+
echo "# and have root level access to the local filesystem." >>$dc
199+
echo "# With those permissions one can run 'mariadb' directly" >>$dc
200+
echo "# anyway thanks to unix socket authentication and hence" >>$dc
201+
echo "# this file is useless. See package README for more info." >>$dc
202+
echo "[client]" >>$dc
203+
echo "host = localhost" >>$dc
204+
echo "user = root" >>$dc
205+
echo "[mysql_upgrade]" >>$dc
206+
echo "host = localhost" >>$dc
207+
echo "user = root" >>$dc
208+
echo "# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." >>$dc
195209
fi
196210
# Keep it only root-readable, as it always was
197211
chown 0:0 $dc

0 commit comments

Comments
 (0)