/etc/init.d/apache2 restart fails on busy webservers

Bug #270899 reported by James Troup on 2008-09-16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Apache2 Web Server
apache2 (Ubuntu)

Bug Description

Binary package hint: apache2

We have a recurring problem with the weekly logrotation restart of apache not coming back on busy web servers. It doesn't happen every week, but it's no fun when it does because it means someone gets calls early on a Sunday morning.

Related branches

Andy Loughran (andylockran) wrote :

Please can you provide the versions of logrotate, apache, and ubuntu you are using please. As well as kernel version.

Do you have any steps you can take to reproduce this action?

Changed in apache2:
status: New → Incomplete

andylockran <email address hidden> writes:

> Please can you provide the versions of logrotate, apache, and ubuntu you
> are using please. As well as kernel version.

Well, Hardy, so:

apache2-mpm-worker 2.2.8-1ubuntu0.3
logrotate 3.7.1-3
Kernel 2.6.24-19-server

> Do you have any steps you can take to reproduce this action?

Actually, sorry, I've just noticed that the default logrotate file
uses 'reload' rather than 'restart', which is great but I still think
'restart' should work better for a busy server. The fundamental
problem seems to be that it tries to shut down gracefully, but that
takes too long for a busy server. Rather than then shutting down hard
(e.g. kill -9), it just gives up, and immediately tries to start again
(which of course fails).

Anyway, to reproduce: run a very busy webserver and run
'/etc/init.d/apache2 restart'.


Chuck Short (zulcss) wrote :

Sounds reasonable to me. Ill do some testing locally here before uploading to proposed.


Changed in apache2:
status: Incomplete → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apache2 - 2.2.9-7ubuntu2

apache2 (2.2.9-7ubuntu2) intrepid; urgency=low

  * debian/logrotate: Restart rather than reload for busy websites.
    (LP: #270899)

 -- Chuck Short <email address hidden> Thu, 18 Sep 2008 08:42:22 -0400

Changed in apache2:
status: Confirmed → Fix Released
Daniel Hahler (blueyed) wrote :

This change has been reverted in 2.2.9-7ubuntu3 - setting back to Triaged.

Changed in apache2:
importance: Undecided → High
status: Fix Released → Triaged
Daniel Hahler (blueyed) wrote :

See also bug 23938 ("Apache2 logrotate kills existing connections on server") - where "restart" has been changed to "graceful-reload".

Matt Zimmerman (mdz) wrote :

Per Rick, Chuck is working on this, so setting to In Progress

Changed in apache2:
assignee: nobody → zulcss
status: Triaged → In Progress
Stefan Fritsch (sf-sfritsch) wrote :

Since 2.2.9-2, "/etc/init.d/apache2 restart" does a hard (non-graceful) restart again, so this should already be fixed in Intrepid.

James, do you also experience hangs with the default action "/etc/init.d/apache2 reload" during logrotate? If the problem is only with restart, you could just get the init script from Intrepid.

Chuck Short (zulcss) wrote :


I have backported the fix from karmic to fix this in hardy.


Is it fixed or back again?
On 6th of June Apche stopped after logrotating.
Reproducable this hapend when using graceful for reloading.

Installed Software:
Lucid 32Bit

The strange thing it happens only on one server. I compared it with other servers, having the exact same setup: No difference, except on this server are SSL-VHosts. But even disabling them: apace2ctl graceful and apache hangs / the task are not stopping.

For now I have no idea what I can check.

Dave Walker (davewalker) wrote :

@Andreas, I'm really confused that you are experiencing this on some servers - but not others. Have you been able to find out any further information?


Stefan Fritsch (sf-sfritsch) wrote :

A possible culprit is mod_php. Andreas, do you use mod_php and if yes, which php extensions have you loaded?

Thierry Carrez (ttx) wrote :

Chuck, can you please update status on this one ?

Changed in apache2 (Ubuntu):
status: In Progress → Triaged
assignee: Chuck Short (zulcss) → nobody
pc_sec (ahakim338) on 2015-06-17
Changed in apache2 (Ubuntu):
status: Triaged → New
ali (ahag6431) on 2015-07-31
Changed in apache2 (Ubuntu):
status: New → Incomplete
status: Incomplete → Confirmed
cooolman (coolman) wrote :

Please update apache2 for ununtu 15.10 to version 2.4.16

bilal (coart) on 2017-04-07
Changed in apache2 (Ubuntu):
status: Confirmed → New
Joshua Powers (powersj) wrote :

Hi, I know this bug is very old, but it showed up during the server team's daily bug triage.

Based on the comments it appears this was fixed, but waiting on confirmation and/or additional information from the reporter. Because this isn't clear I am going to mark this as incomplete and allow someone to add additional information as to whether it still exists or is fixed.


Changed in apache2 (Ubuntu):
status: New → Incomplete


I can confirm this bug. We have four servers running ubuntu xenial. Three of them had automatically updated apache2 to this version and after update apache service was not running! I had to manually start them again.

And with one another server I did manual update to apache2 package and also after that, apache2 service was stopped.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers