[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Solutions for the Apache upgrade hell

At Wed, 23 Jul 2014 01:52:30 +0200,
Arno Töll wrote:
> However, if you call aptitude --purge-unused:
> - apt purges apache2.2-common. This calls apache2.2-common's postrm
> purge, wiping all our configuration
> - install apache2{-bin,-data}
> - preinst apache2 detects an upgrade, but has no clue about the previous
> state, because apt purged everything before we could look at it
> - force removal of old modules as there is no apache2.2-common anymore
> - postinst apache2 is a bit helpless and works through, but does not
> treat the installation as new and does therefore not set system defaults
> as it thinks "we're upgrading"

What about doing a stable update to apache2.2-common adding a
confirmation prompt to one of the maintainer scripts similar to the
confirmation prompt you get when you remove the kernel you are
currently running? Such a small change should be okay for stable.

We probably don't want to add a confirmation for every purge, but I
also don't know of an easy way to figure out that the package is (1)
purged and not only removed and (2) that is done because of the
upgrade. When postrm is called with "purge" the configuration files
are already removed, so that does't really help. Doing "ps auxww |
grep purge" is a bit hackish, but maybe it is good enough for what we
want to do.

With regards to detecting the upgrade, the first thing apt does is
purging apache2.2-common, so none of the other apache packages are
installed when that happens. Maybe it is good enough to check whether
the apache2-data packages is available?  Detecting that the purge
happens after the upgrade can probably be done by checking which
package owns the configuration files.

Kind regards,

Jeroen Dekkers

Reply to: