[debian-mysql] mysql-server-5.5.postrm [was: Re: Resyncing with Ubuntu]
Clint Byrum
spamaps at debian.org
Tue Feb 11 16:44:56 UTC 2014
Excerpts from Robie Basak's message of 2014-02-11 01:28:04 -0800:
> On Mon, Feb 10, 2014 at 09:31:51AM -0800, Clint Byrum wrote:
> > Seems to me that Conflicts is wrong and trying to work around having
> > to remove mysql-server-5.1 before installing mysql-server-5.5 is no
> > longer a problem we'll have if we ship a mysql-server-5.6 that simply
> > Breaks/Replaces mysql-server-5.5. In this case mysql will be stopped,
> > 5.6 will be configured, and then 5.5 will be removed.
>
> So a user installs this mysql-server-5.6. mysql-server-5.5 is removed.
>
> Now mysql-server-5.6 is installed, and mysql-server-5.5 is removed (but
> not purged). So far so good.
>
> The user now purges mysql-server-5.5 after observing it is no longer
> used.
>
> mysql-server-5.5.postrm runs, and deletes everything in /var/lib/mysql;
> thus destroying files that mysql-server-5.5 is using.
>
> AIUI, this was bug 307473.
>
> I don't know what the correct solution is, but it seems to me that
> removing /var/lib/mysql during purge is the wrong thing to do if at any
> time some other package owns that directory.
I'm sorry, I should have read the code before spouting.
The init handling code seems to have very little to do with the purging
code. I see why it is in the conditional, because we don't want to be
removing links for an already owned file.
I think the right thing to do is to put the purging code _above_
#DEBHELPER#, and exit 0 before #DEBHELPER# if we detect another
mysql-server-* package. We should also remove invoke-rc.d stop code,
as that is supposed to be handled by prerm.
That is all orthogonal to the conflicts, which I believe should be
changed to breaks/replaces.
/var/lib/mysql will not be purged automatically by dpkg, as it will
not be empty, and it will still be owned by mysql-server-5.6. So I don't
see why we'd keep the Conflicts.
More information about the pkg-mysql-maint
mailing list