[debian-mysql] Bug#767597: Bug#767597: Bug#767597: mariadb-server-10.0: piuparts / Package purging left files on system
Otto Kekäläinen
otto at seravo.fi
Sat Nov 1 12:47:19 UTC 2014
More information:
In the files (mariadb/mysql)-server.X.X.postrm there is a section that
does the removal and it looks like this:
#
# - Do NOT purge logs or data if another mysql-sever* package is
installed (#307473)
# - Remove the mysql user only after all his owned files are purged.
#
if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld
\) ]; then
# we remove the mysql user only after all his owned files are purged
rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
rm -rf /var/log/mysql
db_input high mysql-server-10.0/postrm_remove_databases || true
db_go || true
db_get mysql-server-10.0/postrm_remove_databases || true
if [ "$RET" = "true" ]; then
# never remove the debian.cnf when the databases are still existing
# else we ran into big trouble on the next install!
rm -f /etc/mysql/debian.cnf
rm -rf /var/lib/mysql
rm -rf /var/run/mysqld # this directory is created by the init
script, don't leave behind
userdel mysql || true
fi
fi
Should this perhaps be re-written in some way?
Sources:
http://anonscm.debian.org/cgit/pkg-mysql/mysql-5.5.git/tree/debian/mysql-server-5.5.postrm
http://anonscm.debian.org/cgit/pkg-mysql/mysql-5.6.git/tree/debian/mysql-server-5.6.postrm
http://anonscm.debian.org/cgit/pkg-mysql/mariadb-5.5.git/tree/debian/mariadb-server-5.5.postrm
http://anonscm.debian.org/cgit/pkg-mysql/mariadb-10.0.git/tree/debian/mariadb-server-10.0.postrm
More information about the pkg-mysql-maint
mailing list