Make default prepare script handle mysql correctly
Right now the mysql section of the prepare script assumes we can run mysql --defaults-files=...
but this is not true for e.g. mariadb on focal.
But worse than that, the script right now does
if [ -f /etc/mysql/my.cnf ] ; then
SOCKET=`$some_awk_stuff </etc/mysql/my.cnf`
[ -S $SOCKET ] && .. # do stuff
fi
For a long time now, /etc/mysql/my.conf just includes other files, so SOCKET=''
in practice. But the lack of quoting on the next line means we're evaluating [ -S ]
(true) rather than [ -S "" ]
(false) - so we end up doing stuff and get away with it all, but due to luck rather than judgement! All this means that in practice the current check is really
[ -f /etc/mysql/my.cnf ] && do stuff