[Bug 1782806] Re: Typo in apache2-maintscript-helper causes MPM check to misfire

Andreas Hasenack andreas at canonical.com
Fri Oct 26 17:25:03 UTC 2018


Bionic Verification
===================

First, confirming the bug:
ubuntu at bionic-apache2-1782806:~$ apt-cache policy apache2
apache2:
  Installed: 2.4.29-1ubuntu4.4
  Candidate: 2.4.29-1ubuntu4.4
  Version table:
 *** 2.4.29-1ubuntu4.4 500
        500 http://br.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages


# prep
ubuntu at bionic-apache2-1782806:~$ sudo cp /etc/apache2/mods-available/{mpm_prefork,prefork}.conf
ubuntu at bionic-apache2-1782806:~$ sudo cp /etc/apache2/mods-available/{mpm_prefork,prefork}.load
ubuntu at bionic-apache2-1782806:~$ sudo ln -s /etc/apache2/mods-{available,enabled}/prefork.load
ubuntu at bionic-apache2-1782806:~$ sudo ln -s /etc/apache2/mods-{available,enabled}/prefork.conf

# this should fail
ubuntu at bionic-apache2-1782806:~$ sudo apt install libapache2-mod-php7.2 -y
...
Creating config file /etc/php/7.2/apache2/php.ini with new version
apache2_switch_mpm prefork: No action required
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)


Bug confirmed.

Confirming fix

a) upgrading from the broken package to the fixed one
Starting with this scenario. Note how the php module package is in a failed state:
ubuntu at bionic-apache2-1782806:~$ dpkg -l|grep apache2
ii  apache2                        2.4.29-1ubuntu4.4
ii  apache2-bin                    2.4.29-1ubuntu4.4
ii  apache2-data                   2.4.29-1ubuntu4.4
ii  apache2-utils                  2.4.29-1ubuntu4.4
iF  libapache2-mod-php7.2          7.2.10-0ubuntu0.18.04.1

ubuntu at bionic-apache2-1782806:~$ sudo apt install apache2 apache2-bin
apache2-data apache2-utils

(...)
Setting up apache2 (2.4.29-1ubuntu4.5) ...
info: Switch to mpm prefork for package libapache2-mod-php7.2
Module mpm_event disabled.
Enabling module mpm_prefork.
info: Executing deferred 'a2enmod php7.2' for package libapache2-mod-php7.2
Enabling module php7.2.
W: APT had planned for dpkg to do more than it reported back (20 vs 24).
   Affected packages: libapache2-mod-php7.2:amd64

# php is now ok
ubuntu at bionic-apache2-1782806:~$ dpkg -l|grep libapache2-mod-php
ii  libapache2-mod-php7.2          7.2.10-0ubuntu0.18.04.1           amd64        server-side, HTML-embedded scripting language (Apache 2 module)

# apt -f install is clean:
ubuntu at bionic-apache2-1782806:~$ sudo apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.


b) Starting out with the condition that shows the bug, but with the fixed package from proposed:
ubuntu at bionic-apache2-1782806:~$ apt-cache policy apache2
apache2:
  Installed: 2.4.29-1ubuntu4.5
  Candidate: 2.4.29-1ubuntu4.5
  Version table:
 *** 2.4.29-1ubuntu4.5 500
        500 http://br.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages


# Creating the condition for the bug, as before:
ubuntu at bionic-apache2-1782806:~$ sudo cp /etc/apache2/mods-available/{mpm_prefork,prefork}.conf
ubuntu at bionic-apache2-1782806:~$ sudo cp /etc/apache2/mods-available/{mpm_prefork,prefork}.load
ubuntu at bionic-apache2-1782806:~$ sudo ln -s /etc/apache2/mods-{available,enabled}/prefork.load
ubuntu at bionic-apache2-1782806:~$ sudo ln -s /etc/apache2/mods-{available,enabled}/prefork.conf
ubuntu at bionic-apache2-1782806:~$ 

# installing the php module. It works this time:
ubuntu at bionic-apache2-1782806:~$ sudo apt install libapache2-mod-php7.2 -y
...
Creating config file /etc/php/7.2/cli/php.ini with new version
Setting up libapache2-mod-php7.2 (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.2
ubuntu at bionic-apache2-1782806:~$ 

Verification succeeded.

** Tags removed: verification-needed-bionic
** Tags added: verification-done-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Server, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1782806

Title:
  Typo in apache2-maintscript-helper causes MPM check to misfire

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1782806/+subscriptions



More information about the Ubuntu-server-bugs mailing list