[debian-mysql] Bug#853008: Bug#853008: Bug#853008: mysql-server-5.7: purge could delete mariadb-server files with inadequate warning

Robie Basak robie.basak at ubuntu.com
Mon Jan 30 18:38:16 UTC 2017


On Mon, Jan 30, 2017 at 06:02:30PM +0000, Julian Gilbey wrote:
> There is an issue with this: the postrm's in mysql-server-5.7 and
> mariadb-server-10.1 do significantly more than just removing
> /var/lib/mysql when purging - see my (now broken because of this!)
> patches on bug#852495: they also do all of the debhelper fragments
> which should only be performed on the purge of the final mysqld
> instance.  These clearly don't belong in the server-core packages, and
> it would be strange (and perhaps wrong) to shift them there.

You reminded me that the *-core packages are supposed to provide the
binaries without any "smarts". So a user might expect to use them and
manage /var/lib/mysql manually. So perhaps it is indeed entirely
inappropriate to put purging code in the *-core package postrm.

> So how about this, just a sketch at the moment rather than a full
> patch?

Your sketch seems good to me, assuming that "dpkg-query --search" is
permitted from maintainer scripts (I know there are some re-entrancy
problems with some particular types of dpkg-related invocations?)

> I *think* this covers the cases, but I'm really not certain.

I'm also not certain.

> a possibility that someone could be purging the old mysql-* packages
> while installing a newer replacement, and I'm not sure how aptitude
> would handle that one because of the somewhat complex
> Breaks/Conflicts/Replaces settings in the various control files.  But
> a sysadmin who tries to purge an old mysql-server-providing package
> simultaneously to installing a new one is potentially asking for
> things to be deleted, so I'm not overly concerned about this.  They
> would still be asked about deleting data in this case, so there is a
> safety net.  (But they could conceivably lose their apparmor settings
> and so on.)

I wondered this too. But without thinking it through in more detail,
it'd certainly be better than what we have now.

Robie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20170130/ff27d195/attachment-0003.sig>


More information about the pkg-mysql-maint mailing list