Modules fail to enable when configured after apache2 is configured
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | apache2 (Ubuntu) |
High
|
Colin Watson | ||
Bug Description
This is related to Debian bug 745834 and Launchpad bug 1312854, which Stefan kindly fixed in http://
The fix seems to work fine in Debian, but not in Ubuntu, though I haven't been able to figure out why. It seems to be a difference in behaviour between dpkg 1.17.21 in Debian and dpkg 1.17.21ubuntu1 in Ubuntu.
The code:
if ! dpkg-query -f '${Status}' -W apache2|grep -q installed; then
is inside apache2-
I thought this was a bit dubious as I seem to recall something about dpkg reentrancy within a maintainer script to be unreliable and not recommended, though I can't find any reference to that right now.
I can reproduce this on Ubuntu (with vivid-proposed in sources.list) by running "apt-get install apache2 libapache2-
In both these cases apache2 is configured first, and then libapache2-
On Debian, I cannot reproduce this. The result of "if ! dpkg-query -f '${Status}' -W apache2|grep -q installed" seems to be the opposite in exactly the same scenario.
So I'm not sure whether I can file this as a bug in Debian since I don't know whether the dpkg-query is defined to work, or in fact why Debian and Ubuntu behave differently on this.
Adding a dpkg task, since it'd be nice to have a definitive answer (that applies to Debian too) as to whether this call is defined to work as expected, or if it is documented to not be permitted to be used.
If we cannot do it this way, then maybe touching a file in apache2.postinst (and removing it in prerm or wherever) would be another way to test to see if apache2 is configured yet, that would work for us in this case.
| Robie Basak (racb) wrote : | #1 |
| Colin Watson (cjwatson) wrote : | #2 |
It took me a while to figure out how to reproduce this reliably; at first I could reproduce it only in the context of autopkgtest, but not in a minimal schroot. It took some strace analysis to figure it out. This is not a dpkg bug after all.
What's happening here is that apache2 in Ubuntu ships ufw profiles, which means that it fires the ufw trigger, but only if ufw is installed (so in order to reproduce this in a minimal schroot you first need to install ufw). This causes apache2 to have "Status: install ok triggers-awaited" rather than the more usual "Status: install ok installed".
I've uploaded apache2 to tolerate the "triggers-awaited" and "triggers-pending" states here. I expect this to clear these autopkgtest failures.
| no longer affects: | dpkg (Ubuntu) |
| Changed in apache2 (Ubuntu): | |
| status: | New → Fix Committed |
| assignee: | nobody → Colin Watson (cjwatson) |
| importance: | Undecided → High |
| Launchpad Janitor (janitor) wrote : | #3 |
This bug was fixed in the package apache2 - 2.4.10-8ubuntu2
---------------
apache2 (2.4.10-8ubuntu2) vivid; urgency=medium
* Allow "triggers-awaited" and "triggers-pending" states in addition to
"installed" when determining whether to defer actions or process
deferred actions (LP: #1393832).
-- Colin Watson <email address hidden> Wed, 26 Nov 2014 11:31:44 +0000
| Changed in apache2 (Ubuntu): | |
| status: | Fix Committed → Fix Released |


I tried building 1.17.21 from Debian on Vivid, downgrading to that, and I still get the same (different) behaviour on Vivid. So it seems that it isn't directly a dpkg version difference, but perhaps something else different in Ubuntu (or dpkg configuration?) that is causing this difference in behaviour.