Upgrade of libapache2-mod-php8.1 does not reload apache2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Debian) |
New
|
Unknown
|
|||
apache2 (Ubuntu) |
Fix Released
|
Undecided
|
Athos Ribeiro | ||
Focal |
In Progress
|
Undecided
|
Athos Ribeiro | ||
Jammy |
In Progress
|
Undecided
|
Athos Ribeiro | ||
Mantic |
Won't Fix
|
Undecided
|
Athos Ribeiro | ||
Noble |
Fix Released
|
Undecided
|
Athos Ribeiro |
Bug Description
[ Impact ]
The apache2-
Package triggers may be specially useful in cases where software plugins or extensions are changed. This is the case of PHP: it relies on such triggers to request apache2 restarts in the libapache2-
Since there is no support for triggers in apache2-
[ Test Plan ]
A test script is available at https:/
First, verify the issue by running `UBUNTU_
- before an update,
- after an update, and
- after a restart.
Without the fix, only the version after the restart should be different.
Then, run it with `TEST_FIX=1 UBUNTU_SERIES=jammy ./reproducer.sh`.
Now, the only different version should be the one before the update (meaning that updating the package will ensure the new version is running within the web server right after the update). Make sure to adjust UBUNTU_SERIES accordingly.
Also, the script was written to use the proposed fix from a PPA, is should be adjusted to fetch it from the -proposed pocket once the fix is accepted.
[ Where problems could occur ]
There may be situations we did not account for where supporting "postinst triggered" in the helper script is not a supported use case. This should most likely be analyzed in a case-by-case fashion.
FWIW, AFAICT, PHP is the only package using apache2's maintscript-helper to restart the service through a trigger (based on queries in Debian codesearch).
[ Other Info ]
Since we are touching an apache2 helper used by several other packages, we wanted to get input from Debian before landing this SRU to ensure this is something we will merge upstream at some point. Since we still did not get a reply, let's move forward here to ensure we get a fix in noble (this is an important bug if users are led to believe apache2 is being restarted when they update PHP).
[ Original Message ]
Today we discovered that most of our servers that are running Apache2 + libapache2-mod-php had Apache2 running with an older version of PHP, even though libapache2-
After investigating, we found that libapache2-
The expected behavior is that after upgrading or reinstalling libapache2-
As far as we could find, the problem exists in apache2-
APACHE2_
APACHE2_
APACHE2_
That means that the apache2_
Output of the trigger of a reinstall of libapache2-
Processing triggers for libapache2-
+ APACHE2_
+ + egrep -q installed|
dpkg-query -f ${Status} -W apache2
+ [ -z triggered ]
+ APACHE2_
+ [ postinst ]
+ APACHE2_
+ [ -z libapache2-
+ [ -z ]
+ APACHE2_
+ [ -z ]
+ APACHE2_
+ [ triggered = triggered ]
+ [ /etc/php/
+ [ -e /usr/share/
+ . /usr/share/
+ [ -n 1 ]
+ return
+ apache2_reload restart
+ apache2_
+ [ triggered = configure ]
+ return 1
+ return 0
+ exit 0
Although I would be highly surprised if this is actually an issue that has not been reported yet, I could not find any reports mentioning this behavior. Also, there's a security element to this: we expected the package upgrades (we're running unattended updates) to ensure the PHP version we're running is uptodate, but now it turns out we're running old versions of PHP without us knowing.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: libapache2-
ProcVersionSign
Uname: Linux 5.19.0-43-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: GNOME
Date: Tue Oct 10 11:53:51 2023
InstallationDate: Installed on 2023-05-01 (161 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
SourcePackage: php8.1
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 38 lines (+12/-0)2 files modifieddebian/changelog (+8/-0)
debian/debhelper/apache2-maintscript-helper (+4/-0)
- Andreas Hasenack: Needs Information
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 38 lines (+12/-0)2 files modifieddebian/changelog (+8/-0)
debian/debhelper/apache2-maintscript-helper (+4/-0)
- Andreas Hasenack: Needs Information
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 38 lines (+12/-0)2 files modifieddebian/changelog (+8/-0)
debian/debhelper/apache2-maintscript-helper (+4/-0)
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 38 lines (+12/-0)2 files modifieddebian/changelog (+8/-0)
debian/debhelper/apache2-maintscript-helper (+4/-0)
tags: | added: server-todo |
Changed in php8.1 (Ubuntu): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
Changed in apache2 (Ubuntu): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
Changed in apache2 (Debian): | |
status: | Unknown → New |
tags: | removed: server-todo |
tags: | added: server-todo |
description: | updated |
description: | updated |
description: | updated |
Changed in apache2 (Ubuntu Mantic): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
status: | New → Triaged |
Changed in apache2 (Ubuntu Noble): | |
status: | New → Triaged |
Changed in apache2 (Ubuntu Jammy): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
status: | New → Triaged |
Changed in apache2 (Ubuntu Focal): | |
assignee: | nobody → Athos Ribeiro (athos-ribeiro) |
status: | New → Triaged |
Changed in apache2 (Ubuntu Noble): | |
status: | Triaged → Fix Committed |
Changed in apache2 (Ubuntu Jammy): | |
status: | Triaged → In Progress |
Changed in apache2 (Ubuntu Focal): | |
status: | Triaged → In Progress |
no longer affects: | php8.1 (Ubuntu) |
no longer affects: | php8.1 (Ubuntu Focal) |
no longer affects: | php8.1 (Ubuntu Jammy) |
no longer affects: | php8.1 (Ubuntu Mantic) |
no longer affects: | php8.1 (Ubuntu Noble) |
Dear maintainer,
Thanks for taking the time to look at this. maintscript- helper fixes the problem. I hope it will be useful.
The attached patch to apache2-
If there's anything I can do to help or test, please let me know.
Best regards, Roel