We should apply same patch as for squid, because often apache doesn't stop
immediately. Proposed patch attached.
Created attachment 71512 [details, diff]
apache2 clean shutdown patch
why? It does stop.
The real solution is to either from backport or use 2.1, which has the
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
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.
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.
*** Bug 145596 has been marked as a duplicate of this bug. ***
(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.
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.
*** Bug 163162 has been marked as a duplicate of this bug. ***
*** Bug 164717 has been marked as a duplicate of this bug. ***
>and so stops and restarts now work correctly.
Apparently not. Bug 164717
*** Bug 165448 has been marked as a duplicate of this bug. ***
People are still moaning about this... Reopen.
Sorry for the dup... I should have thought to search closed bugs too?
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.
This should be fixed now.
*** Bug 206730 has been marked as a duplicate of this bug. ***
*** Bug 210272 has been marked as a duplicate of this bug. ***
(In reply to comment #15)
> This should be fixed now.
How exactly has this been fixed? Is there a patch/version we can test?
(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.
Has anyone filed a bug for this upstream yet?
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:
*** Bug 211690 has been marked as a duplicate of this bug. ***
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.
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
i have to specify a comment
fixed in svn with much less code
I thought the whole point was that this was a bug the developers at apache needed to fix?
(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 ...