Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 110556

Summary: apache2: clean shutdown patch
Product: Gentoo Linux Reporter: Michal Margula <alchemyx>
Component: [OLD] ServerAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: RESOLVED FIXED    
Severity: major CC: aksansai, anakin.skyw, birder, hurikhan77+bgo, john.mcfarlane, mail, mattsch, peter, polynomial-c, z23
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: apache2 clean shutdown patch

Description Michal Margula 2005-10-26 08:57:03 UTC
We should apply same patch as for squid, because often apache doesn't stop
immediately. Proposed patch attached.
Comment 1 Michal Margula 2005-10-26 08:58:07 UTC
Created attachment 71512 [details, diff]
apache2 clean shutdown patch
Comment 2 Paul Querna 2005-10-26 10:08:04 UTC
why?  It does stop.

The real solution is to either from backport or use 2.1, which has the
graceful-stop feature.
Comment 3 Michal Margula 2005-10-26 10:38:12 UTC
On loaded servers when you issue /etc/init.d/apache stop it takes at least 5 to
10 seconds before every process dissapears (I am using mpm-worker if it gives
any hint).

Adding that solved problem, especialy when running apache restart, which always
failed because of not-yet-dead processes of apache. I think it is clean and good
solution, it does no harm for anybody not needing that feature.
Comment 4 Peter Kerwien 2006-05-02 12:01:40 UTC
I would also like to see that something was done to the restart problem of apache. Often a restart fails, and you need to do a start after the failed restart.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-08-30 06:58:25 UTC
*** Bug 145596 has been marked as a duplicate of this bug. ***
Comment 6 Kai Krakow 2006-09-01 08:51:58 UTC
(In reply to comment #2)
> why?  It does stop.
> 
> The real solution is to either from backport or use 2.1, which has the
> graceful-stop feature.

Why? Yes, it does stop, but it does not immediatly restart - because it does not immediatly stop.

I ask myself why you are argumenting against a quickfix. As far as I can see your argumentation is now almost 1 year old, I suggestion of backporting was not picked up. But apache2 is marked stable.

Either the quickfix should be applied and a new bug should be opened for improving this - or apache 2.0 should be put back to testing or unstable.

It is currently unusable in a production environment when you do automated restarts because it is totally unreliable.

Sorry, just my 2 pence. I love Gentoo for it's stability and affords to keep packages stable with custom patches applied by the ebuilds (and 2.1 isn't marked stable). This argumentation is just ignorance. "The right way" is subject to your liking, not to the community's a/o users' liking.
Comment 7 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-10-15 16:12:24 UTC
We have moved to using start-stop-daemon in apache 2.0.59-r1. start-stop-daemon should do all the heavy lifting for us, and so stops and restarts now work correctly.
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-01-22 07:24:55 UTC
*** Bug 163162 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2007-01-31 17:30:10 UTC
*** Bug 164717 has been marked as a duplicate of this bug. ***
Comment 10 UncleOwen 2007-01-31 23:59:47 UTC
>and so stops and restarts now work correctly.

Apparently not. Bug 164717
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-02-05 14:31:11 UTC
*** Bug 165448 has been marked as a duplicate of this bug. ***
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-02-05 14:31:29 UTC
People are still moaning about this... Reopen.
Comment 13 John McFarlane 2007-02-05 14:38:44 UTC
Sorry for the dup... I should have thought to search closed bugs too?
Comment 14 Marco Clocchiatti 2007-04-09 07:28:38 UTC
I had a lot of problems with apache-2.2.4 stop and restart functions.

1. start-stop-daemon does not work, while apache2ctl does. This behaviour is undependent from the following observations.
2. http.conf does explicitly not use "PidFile" voice and defaults to /var/run/apache2.pid. I thing may be better to add an explicit line for it.
3. init script uses explicitly the option "--pidfile" setted to /var/run/apache2.pid. I thing may it be better to insert a variable in /etc/conf/apache to change this choice.
Comment 15 Christian Heim (RETIRED) gentoo-dev 2007-05-26 18:20:47 UTC
This should be fixed now.
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2008-01-20 09:16:14 UTC
*** Bug 206730 has been marked as a duplicate of this bug. ***
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2008-02-15 19:29:35 UTC
*** Bug 210272 has been marked as a duplicate of this bug. ***
Comment 18 Matthew Schultz 2008-02-15 19:37:43 UTC
(In reply to comment #15)
> This should be fixed now.
> 

How exactly has this been fixed?  Is there a patch/version we can test?
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2008-02-15 19:39:37 UTC
(In reply to comment #18)
> How exactly has this been fixed?  Is there a patch/version we can test?

No, there's no fix if you still have the issue. Providing a wrong return status is none of Gentoo problem, take it upstream. 
Comment 20 Matthew Schultz 2008-02-15 19:42:52 UTC
Has anyone filed a bug for this upstream yet?
Comment 21 Matthew Schultz 2008-02-15 20:06:18 UTC
Since I could not find a bug reported on this upstream, I filed one myself there.  Here's a link to the bug if you want to track it:

http://issues.apache.org/bugzilla/show_bug.cgi?id=44433
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2008-02-28 05:05:37 UTC
*** Bug 211690 has been marked as a duplicate of this bug. ***
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2008-02-28 06:17:36 UTC
Since people keep adding themselves here: you do NOT want to use restart, pretty much ever. Use /etc/init.d/apache2 reload if all you are after is reloading your configuration. You can configure how the reload will be done via RELOAD_TYPE variable in /etc/conf.d/apache2 (most likely you just want to stick with the default graceful one).

For more info, see http://httpd.apache.org/docs/2.2/stopping.html

If you want /etc/init.d/restart to work as with all the rest of the stuff out there, make upstream fix it - http://issues.apache.org/bugzilla/show_bug.cgi?id=44433 - since restart really means stop && start and the second part won't happen until the first one succeeded; alas apache doesn't bother itself with checking properly whether it really stopped first, and just returns success.
Comment 24 Benedikt Böhm (RETIRED) gentoo-dev 2008-02-28 16:28:29 UTC
the reason we don't actually fix (read: workaround) this, can be easily seen at http://svn.debian.org/viewsvn/pkg-apache/trunk/apache2/apache2.2-common.apache2.init?rev=544&view=markup

such crap is just not maintainable
Comment 25 Benedikt Böhm (RETIRED) gentoo-dev 2008-03-22 15:33:48 UTC
i have to specify a comment
Comment 26 Benedikt Böhm (RETIRED) gentoo-dev 2008-03-22 15:34:32 UTC
fixed in svn with much less code
Comment 27 Matthew Schultz 2008-03-23 17:52:45 UTC
I thought the whole point was that this was a bug the developers at apache needed to fix?
Comment 28 Benedikt Böhm (RETIRED) gentoo-dev 2008-03-24 00:28:26 UTC
(In reply to comment #27)
> I thought the whole point was that this was a bug the developers at apache
> needed to fix?
> 

yes, but i decided we cannot wait until upstream fixes their signal mess, i tried it, but gave up after two hours or so ...