Apache fails to shutdown cleanly during update and removes libapache2-mod-php5 in the process, causing service restart to fail due to syntax errors in configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
# lsb_release -rd
Description: Ubuntu 10.04.4 LTS
Release: 10.04
# apt-cache policy apache2
apache2:
Installed: 2.2.14-5ubuntu8.9
Candidate: 2.2.14-5ubuntu8.9
Version table:
*** 2.2.14-5ubuntu8.9 0
500 http://
100 /var/lib/
2.
500 http://
2.
500 http://
# apt-cache policy libapache2-mod-php5
libapache2-
Installed: 5.3.2-1ubuntu4.14
Candidate: 5.3.2-1ubuntu4.14
Version table:
*** 5.3.2-1ubuntu4.14 0
500 http://
500 http://
100 /var/lib/
5.3.2-1ubuntu4 0
500 http://
-------
I have observed this behavior several times over the course of a few months now.
It seems that any time I update apache2 and related packages, a) Apache cannot be shutdown cleanly, so all running processes are killed, and b) libapache2-mod-php5 is removed and never reinstalled. The fact that libapache2-mod-php5 is never reinstalled causes Apache to fail to start after the update, due to syntax errors (unrecognized directives) in the Apache configuration.
The apt-get log transcript follows:
-------
Now updating apache2 ..
Installing package(s) with command apt-get -y install apache2 ..
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
apache2-
Suggested packages:
ufw
The following packages will be REMOVED:
apache2-
The following NEW packages will be installed:
apache2-
The following packages will be upgraded:
apache2 apache2-
4 upgraded, 1 newly installed, 2 to remove and 18 not upgraded.
Need to get 3172kB of archives.
After this operation, 8487kB disk space will be freed.
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Reading changelogs...
apache2 (2.2.15-1) unstable; urgency=low
* This release adds and enables mod_reqtimeout, which limits the time
Apache waits for a client to send a complete request. This helps to
mitigate against certain denial of service attacks. In case of problems
with slow clients, the timeout values can be adjusted in
disabled with "a2dismod reqtimeout".
-- Chuck Short <email address hidden> Tue, 13 Apr 2010 09:09:34 -0400
apt-
Fetched 3172kB in 1s (1958kB/s)
(Reading database ... 68899 files and directories currently installed.)
Preparing to replace apache2-
Unpacking replacement apache2-
Preparing to replace apache2 2.2.14-5ubuntu8.8 (using .../apache2_
Unpacking replacement apache2 ...
(Reading database ... 68891 files and directories currently installed.)
Removing libapache2-mod-php5 ...
Module php5 disabled.
Run '/etc/init.
dpkg: apache2-
roundcube-core depends on apache2 | lighttpd | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package lighttpd is not installed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
mailman depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
mediawiki depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
libapache2
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
roundcube-core depends on apache2 | lighttpd | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package lighttpd is not installed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
mailman depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
mediawiki depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
Removing apache2-mpm-prefork ...
* Stopping web server apache2
* We failed to correctly shutdown apache, so we're now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now!
... waiting ...done.
(Reading database ... 68887 files and directories currently installed.)
Preparing to replace apache2.2-common 2.2.14-5ubuntu8.8 (using .../apache2.
Unpacking replacement apache2.2-common ...
Preparing to replace apache2.2-bin 2.2.14-5ubuntu8.8 (using .../apache2.
Unpacking replacement apache2.2-bin ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-
Setting up apache2.2-bin (2.2.14-5ubuntu8.9) ...
Setting up apache2.2-common (2.2.14-5ubuntu8.9) ...
Setting up apache2-
Setting up apache2-mpm-worker (2.2.14-5ubuntu8.9) ...
* Starting web server apache2
Syntax error on line 15 of /etc/apache2/
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
...fail!
invoke-rc.d: initscript apache2, action "start" failed.
Setting up apache2 (2.2.14-5ubuntu8.9) ...
.. install complete.
Hi Ben
Looks like you might have two issue here:
1) apache2-mpm-prefork gets removed which libapache2-mod-php5 depends on:
The following packages will be REMOVED: mpm-prefork libapache2-mod-php5
apache2-
This is because you are running 'apt-get -y install apache2' rather than actually upgrading so apt selects the default worker type - you should run:
sudo apt-get dist-upgrade
or
sudo apt-get update
2) Apache not restarting correctly
Might be caused by the above - please try and see if it still happens.
Otherwise any errors from the apache log files would be good to see.
Marking 'Incomplete' and 'Low' for the time being as I don't think this is a more general issue.