[debian-mysql] Bug#853008: mysql-server-5.7: purge could delete mariadb-server files with inadequate warning
Andreas Beckmann
anbe at debian.org
Tue Jan 31 08:33:17 UTC 2017
On Mon, 30 Jan 2017 09:28:52 +0000 Robie Basak <robie.basak at ubuntu.com>
wrote:
> I think the root cause here is that both MySQL and MariaDB packaging
> "own" /var/lib/mysql. This causes confusion because even though the
> packages Conflict, one can still be purged while the other is installed.
>
> I think that sharing /var/lib/mysql in this way leads to a slew of bugs,
> and we should fix it in the long term so that the packaging doesn't do
> this.
>
> This is https://launchpad.net/bugs/1490071 and
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841345
>
> Unfortunately fixing this properly is quite involved. I've had time to
> think up a solution, but not had time to code it up yet, and I don't
> expect to have the necessary time in the next few months.
I don't know what solution you had in mind, but for solving the shared
ownership of /var/lib/mysql I'd suggest to create a new package, e.g.
"var-lib-mysql", from src:mysql-defaults.
* All server packages (but not server-core packages) will depend on this
new package.
* The new package should have Breaks against all server packages that
existed in the past and didn't conform to this new scheme.
* The new package will be handling the removal of the database directory
upon purge. No other place should care about this in the future. So the
purge logic is in one place only and does need to be kept in sync across
several packages.
* Abusing mysql-common for this task is not a good idea since
mysql-common is being depended upon by client packages.
It may be a bit late to get this into stretch, but not impossible, since
this is "fallout" from the mysql->mariadb transition. But it needs to be
acted quickly, with an unblock filed ideally before the freeze on Feb 5th.
It will not help the jessie->stretch upgrades, but it will make the
stretch->buster upgrades more smooth. And if it's only
mariadb-server-10.1 -> mariadb-server-10.2
In case you need to deactivate the postrm purge action of a removed but
not purged old m*-x.y-server package, you could try something like
sed -i '2iif [ "$1" = "purge" ]; then exit 0; fi # old postrm script
deactivated by $PKG to prevent postrm purge messing around with
/var/lib/mysql, see #853008 for details' $OLD_OTHER_POSTRM
(unwrap, must be a single line)
Andreas
More information about the pkg-mysql-maint
mailing list