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

Bug #270899 reported by James Troup on 2008-09-16
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
High
Unassigned

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'.

--
James

Chuck Short (zulcss) wrote :

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

chuck

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 :

Hi,

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

Thanks
chuck

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
apache2.2_2.2.14-5ubuntu8

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?

Thanks.

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

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

Other bug subscribers