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

Re: apache2-doc update enables disabled conf



On Sat 10 Jul 2021 at 23:46:32 (+0200), Michael wrote:
> On Saturday, July 10, 2021 10:26:03 PM CEST, David Wright wrote:
> > I can't yet understand what you have done here.
> 
> all i did was an apt-get -V dist-upgrade
> 
> 
> > AIUI a2disconf
> > removes symlinks in /etc/apache2/conf-enabled/ that were previously
> > created there by a2enconf.
> 
> that's correct
> 
> 
> > OTOH, apache2-doc.conf is a pkg-provided conffile in
> > /etc/apache2/conf-available/. During an upgrade, it will be
> > automatically upgraded if it hasn't been altered. If you've
> > altered it, then there's usually a dialogue presented about
> > what to do¹.
> 
> afaik this applies only to 'real' config files, like the ones like
> /etc/apache/apache2.conf. apache2 configuration files in /etc/conf-*
> are probably considered different.

My post is out-of-date, in that /var/lib/dpkg/info/apache2-doc.conffiles
is now ignored in favour of debhelper commands, which I'm not
conversant with. However, AFAIK there is only one category of
conffile as far as APT is concerned.

> i never altered this config file (or any other of those)! why should
> i? if i need this file to be changed, i disable it with a2disconf (or
> remove the symlink in /etc/conf-enabled/ myself), copy the source in
> /etc/apache2/conf-available/ and change the copy. i never touch
> original package files if there is a way to circumvent it.
> 
> > But in any case, that's nothing to do with
> > symlinks in /etc/apache2/conf-enabled/.
> 
> agreed.
> 
> > A more specific description of the symptoms might help.
> 
> well, here is what '/var/log/apt/term.log' sais:
> Log started: 2021-07-09  09:01:44
> (Reading database ... ^M(Reading database ... 5%^M(Reading database
> ... 10%^M(Reading database ... 15%^M(Reading database ...
> 20%^M(Reading database ... 25%^M(Reading database ... 30%^M(Reading
> database ... 35%^M(Reading database ... 40%^M(Reading database ...
> 45%^M(Reading database ... 50%^M(Reading database ... 55%^M(Reading
> database ... 60%^M(Reading database ... 65%^M(Reading database ...
> 70%^M(Reading database ... 75%^M(Reading database ... 80%^M(Reading
> database ... 85%^M(Reading database ... 90%^M(Reading database ...
> 95%^M(Reading database ... 100%^M(Reading database ... 41615 files and
> directories currently installed.)
> Preparing to unpack .../apache2_2.4.38-3+deb10u5_amd64.deb ...
> Unpacking apache2 (2.4.38-3+deb10u5) over (2.4.38-3+deb10u4) ...
> Preparing to unpack .../apache2-bin_2.4.38-3+deb10u5_amd64.deb ...
> Unpacking apache2-bin (2.4.38-3+deb10u5) over (2.4.38-3+deb10u4) ...
> Preparing to unpack .../apache2-data_2.4.38-3+deb10u5_all.deb ...
> Unpacking apache2-data (2.4.38-3+deb10u5) over (2.4.38-3+deb10u4) ...
> Preparing to unpack .../apache2-utils_2.4.38-3+deb10u5_amd64.deb ...
> Unpacking apache2-utils (2.4.38-3+deb10u5) over (2.4.38-3+deb10u4) ...
> Preparing to unpack .../apache2-doc_2.4.38-3+deb10u5_all.deb ...
> Unpacking apache2-doc (2.4.38-3+deb10u5) over (2.4.38-3+deb10u4) ...
> Setting up apache2-bin (2.4.38-3+deb10u5) ...
> Setting up apache2-doc (2.4.38-3+deb10u5) ...
> Package apache2 is not configured yet. Will defer actions by package
> apache2-doc.
> Setting up apache2-data (2.4.38-3+deb10u5) ...
> Setting up apache2-utils (2.4.38-3+deb10u5) ...
> Setting up apache2 (2.4.38-3+deb10u5) ...
> info: Executing deferred 'a2enconf apache2-doc' for package apache2-doc
> Enabling conf apache2-doc.
> Processing triggers for man-db (2.8.5-2) ...
> Processing triggers for systemd (241-7~deb10u7) ...
> Log ended: 2021-07-09  09:02:06
> 
> please recognize the lines that say:
> 
>  info: Executing deferred 'a2enconf apache2-doc' for package apache2-doc
>  Enabling conf apache2-doc.
> 
> this tells me that apt-get enables the configuration file although i
> disabled it on purpose.

Yes. Glancing at the scripts in /var/lib/dpkg/info/apache2-doc*,
it's not clear to me where the current enabled-state is retained.
I would've thought it necessary to run a2query before upgrading,
to find out whether to run a2enconf on each element. AFAICT
the deferred 'a2enconf apache2-doc' should not be run unless there's
a symlink in conf-enabled/ (and on fresh installation, of course).
It looks like a bug that resembles #977014, but which should be
at normal level rather than wishlist.

> fwiw: i think 'configuration files' in apache2 are not the same as the
> configuration files of packages you probably thought of (and are right
> about).

Logically, I'd agree that they operate in different ways, but AFAICT
APT sees them as the one category: conffiles.

And that suggests a workaround: Put # at the beginning of each line
in /etc/apache2/conf-available/apache2-doc.conf. Having done this,
'a2enconf apache2-doc' is effectively impotent, and any upgrade
should invoke the dialogue I posted earlier, to which you can reply
N (keep your installed version).

[Note to self: read up on debhelper, and treat
/var/lib/dpkg/info/*conffiles with due circumspection.]

Cheers,
David.


Reply to: