You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2001/10/23 09:13:26 UTC
Re: apachectl reports 'httpd started' when httpd didn't
Sander Temme wrote:
> on 10/22/01 9:17 PM, Stas Bekman at stas@stason.org wrote:
>
>
>>Either httpd returns a wrong status here (too early?):
>>
>>if $HTTPD ; then
>> echo "$0 $ARG: httpd started"
>>
>>or may be an additional check for pid file should be done and report
>>success/failure only then?
>>
>
> Apachectl basically never looks back. I posted a small patch a while ago
> that waits for a couple of seconds after starting httpd and then checks the
> presence of the pid file, but it wasn't picked up.
In fact the problem happens with 'apachectl restart' too. I use:
apachectl stop; sleep 3; apachectl start;
instead. I do this since 'apachectl restart' reports restarted when it
didn't, because the stop wasn't fast enough. This usually happens when
the server is not stopping very fast (dynamic processes).
I wish apachectl was more useful. Or at least won't report things it's
not sure about.
In the perl test framework (Apache::Test) used by httpd-2.0 test suite
we ping the server (by fetching a static page or simply /) before
reporting that it has started and keep on pinging for a few seconds
until ping responds or the failure is reported. I don't see why this
approach cannot be applied to apachectl.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/