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

Bug #270899 reported by James Troup
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Apache2 Web Server
New
Undecided
Unassigned
apache2 (Ubuntu)
Invalid
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

Revision history for this message
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
Revision history for this message
James Troup (elmo) wrote : Re: [Bug 270899] Re: apache doesn't come back up after weekly logrotate restart

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

Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
Daniel Hahler (blueyed) wrote :

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

Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

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

Thanks
chuck

Revision history for this message
Andreas Tauscher (ta-lonestar-bbs) wrote :

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.

Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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)
Changed in apache2 (Ubuntu):
status: Triaged → New
ali (ahag6431)
Changed in apache2 (Ubuntu):
status: New → Incomplete
status: Incomplete → Confirmed
Revision history for this message
cooolman (coolman) wrote :

Please update apache2 for ununtu 15.10 to version 2.4.16

bilal (coart)
Changed in apache2 (Ubuntu):
status: Confirmed → New
Revision history for this message
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.

Thanks!

Changed in apache2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Ville Pouhula (villepouhula) wrote :

Hello!

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.

Revision history for this message
Joshua Powers (powersj) wrote :

Can you get the journal (journalctl -b > file) to help determine what prevented it from starting?

Revision history for this message
Ville Pouhula (villepouhula) wrote :

Well not much information there:

Jun 27 02:24:43 ip-10-15-0-98 systemd[1]: Starting Daily apt activities...
Jun 27 02:25:10 ip-10-15-0-98 systemd[1]: Reloading.
Jun 27 02:25:11 ip-10-15-0-98 systemd[1]: snapd.refresh.timer: Adding 1h 21min 48.884882s random time.
Jun 27 02:25:11 ip-10-15-0-98 systemd[1]: Started ACPI event daemon.
Jun 27 02:25:11 ip-10-15-0-98 systemd[1]: Stopping LSB: Apache2 web server...
Jun 27 02:25:11 ip-10-15-0-98 apache2[22198]: * Stopping Apache httpd web server apache2
Jun 27 02:25:13 ip-10-15-0-98 apache2[22198]: *
Jun 27 02:25:13 ip-10-15-0-98 systemd[1]: Stopped LSB: Apache2 web server.
Jun 27 02:25:13 ip-10-15-0-98 systemd[1]: Reloading.
Jun 27 02:25:13 ip-10-15-0-98 systemd[1]: snapd.refresh.timer: Adding 4h 45min 16.224693s random time.
Jun 27 02:25:13 ip-10-15-0-98 systemd[1]: Started ACPI event daemon.
Jun 27 02:25:14 ip-10-15-0-98 systemd[1]: Reloading.
Jun 27 02:25:14 ip-10-15-0-98 systemd[1]: snapd.refresh.timer: Adding 3h 3min 52.839206s random time.
Jun 27 02:25:14 ip-10-15-0-98 systemd[1]: Started ACPI event daemon.
Jun 27 02:25:16 ip-10-15-0-98 systemd[1]: Reloading.
Jun 27 02:25:16 ip-10-15-0-98 systemd[1]: snapd.refresh.timer: Adding 3h 45min 34.137843s random time.
Jun 27 02:25:16 ip-10-15-0-98 systemd[1]: Started ACPI event daemon.
Jun 27 02:25:16 ip-10-15-0-98 systemd[1]: Reloading.
Jun 27 02:25:17 ip-10-15-0-98 systemd[1]: snapd.refresh.timer: Adding 14min 59.404091s random time.
Jun 27 02:25:17 ip-10-15-0-98 systemd[1]: Started ACPI event daemon.
Jun 27 02:25:25 ip-10-15-0-98 systemd[1]: Started Daily apt activities.
Jun 27 02:25:25 ip-10-15-0-98 systemd[1]: apt-daily.timer: Adding 5h 4min 2.832906s random time.
Jun 27 02:25:25 ip-10-15-0-98 systemd[1]: apt-daily.timer: Adding 4h 14min 17.749588s random time.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Please also take a look at the apache error log files in /var/log/apache2/error.log

Artur (55oliver)
Changed in apache2 (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Ville Pouhula (villepouhula) wrote :
Download full text (17.1 KiB)

Hi again and sorry for the delay, here are some more logfiles:

/var/log/unattended-upgrades/unattended-upgrades.log:
2017-06-27 03:59:09,379 INFO Initial blacklisted packages:
2017-06-27 03:59:09,379 INFO Initial whitelisted packages:
2017-06-27 03:59:09,379 INFO Starting unattended upgrades script
2017-06-27 03:59:09,380 INFO Allowed origins are: ['o=Ubuntu,a=xenial', 'o=Ubuntu,a=xenial-security']
2017-06-27 03:59:25,333 INFO Packages that will be upgraded: apache2 apache2-bin apache2-data apache2-utils
2017-06-27 03:59:25,333 INFO Writing dpkg log to '/var/log/unattended-upgrades/unattended-upgrades-dpkg.log'
2017-06-27 03:59:33,931 INFO All upgrades installed

/var/log/unattended-upgrades/unattended-upgrades-dpkg.log:
Log started: 2017-06-27 03:59:25
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 346214 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.18-2ubuntu3.3_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.3) over (2.4.18-2ubuntu3.2) ...
Preparing to unpack .../apache2-bin_2.4.18-2ubuntu3.3_amd64.deb ...
Unpacking apache2-bin (2.4.18-2ubuntu3.3) over (2.4.18-2ubuntu3.2) ...
Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.3_amd64.deb ...
Unpacking apache2-utils (2.4.18-2ubuntu3.3) over (2.4.18-2ubuntu3.2) ...
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.3_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.3) over (2.4.18-2ubuntu3.2) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up apache2-bin (2.4.18-2ubuntu3.3) ...
Setting up apache2-utils (2.4.18-2ubuntu3.3) ...
Setting up apache2-data (2.4.18-2ubuntu3.3) ...
Setting up apache2 (2.4.18-2ubuntu3.3) ...
insserv: warning: current start runlevel(s) (empty) of script `apache2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `apache2' overrides LSB defaults (0 1 6).
Log ended: 2017-06-27 03:59:33

/var/log/dpkg.log:
2017-06-27 03:59:26 upgrade apache2:amd64 2.4.18-2ubuntu3.2 2.4.18-2ubuntu3.3
2017-06-27 03:59:26 status half-configured apache2:amd64 2.4.18-2ubuntu3.2
2017-06-27 03:59:28 status unpacked apache2:amd64 2.4.18-2ubuntu3.2
2017-06-27 03:59:28 status half-installed apache2:amd64 2.4.18-2ubuntu3.2
2017-06-27 03:59:28 status triggers-pending systemd:amd64 229-4ubuntu10
2017-06-27 03:59:28 status triggers-pending ureadahead:amd64 0.100.0-19
2017-06-27 03:59:28 status triggers-pending ufw:all 0.35-0ubuntu2
2017-06-27 03:59:28 status triggers-pending man-db:amd64 2.7.5-1
2017-06-27 03:59:28 status half-installed...

田林 (a1806695758)
Changed in apache2 (Ubuntu):
status: Confirmed → Fix Committed
status: Fix Committed → Incomplete
Paul Collins (pjdc)
Changed in apache2 (Ubuntu):
status: Incomplete → Confirmed
Changed in apache2 (Ubuntu):
assignee: nobody → farhan saleh robleh (farhn)
Changed in apache2:
assignee: nobody → farhan saleh robleh (farhn)
Colin Watson (cjwatson)
Changed in apache2:
assignee: farhan saleh robleh (farhn) → nobody
Changed in apache2 (Ubuntu):
assignee: farhan saleh robleh (farhn) → nobody
jean (jeanprodutivo)
Changed in apache2 (Ubuntu):
status: Confirmed → Incomplete
nathan (nathan95-b)
Changed in apache2 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.