You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Fermín Galán Márquez <fe...@cttc.es> on 2007/09/04 19:22:15 UTC

[users@httpd] Exit codes reference for httpd binary

Hi,

I would like to know if there is a reference of the "exit codes" of the 
httpd binary (apache2 in the Debian distribution I'm using). After 
browsing at http://httpd.apache.org/docs/2.2/ (and specially 
http://httpd.apache.org/docs/2.2/programs/httpd.html), I haven't found 
any document that describe the topic, so I come to the list in the hope 
of someone could help me, please :)

Maybe it sound a estrange question, but I'm trying to debug a complex 
utilization of the apache2ctl script. The httpd binary is failing to 
start (returning 141 instead of the usual 0) and I'm wondering why...

Thank you very much in advance!

Best regards,

--------------------
Fermín Galán Márquez
CTTC - Centre Tecnològic de Telecomunicacions de Catalunya
Parc Mediterrani de la Tecnologia, Av. del Canal Olímpic s/n, 08860
Castelldefels, Spain
Room 1.02
Tel : +34 93 645 29 12
Fax : +34 93 645 29 01
Email address: fermin dot galan at cttc dot es

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Exit codes reference for httpd binary

Posted by Fermín Galán Márquez <fe...@cttc.es>.
Dear Joshua,

>> I would like to know if there is a reference of the "exit codes" of the
>> httpd binary (apache2 in the Debian distribution I'm using). After
>> browsing at http://httpd.apache.org/docs/2.2/ (and specially
>> http://httpd.apache.org/docs/2.2/programs/httpd.html), I haven't found
>> any document that describe the topic, so I come to the list in the hope
>> of someone could help me, please :)
>>
>> Maybe it sound a estrange question, but I'm trying to debug a complex
>> utilization of the apache2ctl script. The httpd binary is failing to
>> start (returning 141 instead of the usual 0) and I'm wondering why...
>>
>> Thank you very much in advance!
> 
> The server itself just issues 0 for success and 1 for failure as far
> as I know. apachectl has some other codes documented in comments at
> the top of the script.

I referred to the error code returned by the apache binary, not by 
apache2ctl (I've hacked the apache2ctl script to include a simple 'echo 
$ERROR' after the apache2/httpd invocation attempt).

> I don't know where 141 would be coming from. Do you get any
> interesting error messages at the prompt or in the error log? If not,
> try running httpd under strace or the equivalent.

I've finally solved the problem explicitly stating the input, output and 
error descriptor when invoking the apache2ctl as follows:

# apache2ctl start </dev/null >/dev/null 2>/dev/null

Usually, you never need to use that because apache2ctl will inherit such 
descriptors from the parent process (i.e., the shell from where you are 
invoking the command). However, I'm using a "special" shell that doesn't 
run in any terminal (too complex and boring to explain :) and, 
therefore, maybe doesn't has any descriptor to be inherit, thus causing 
the problem.

Although this is a good solution for me, I'm still wondering about if 
that the  apache2/httpd binary returns 141 when it detects a missing 
standard input/output/error descriptor makes sense...

Thank you for your answer!

Best regards,

--------------------
Fermín Galán Márquez
CTTC - Centre Tecnològic de Telecomunicacions de Catalunya
Parc Mediterrani de la Tecnologia, Av. del Canal Olímpic s/n, 08860
Castelldefels, Spain
Room 1.02
Tel : +34 93 645 29 12
Fax : +34 93 645 29 01
Email address: fermin dot galan at cttc dot es

PD. I've seen some "naming offset" between the official documentation 
and my installed apache version. For example, I have 'apache2ctl' 
instead of 'apachectl' and my binary is named 'apache2' instead of 
'httpd'. However, I guess that this is a consequence of my distro 
(Debian) and that only affect names (I mean, the behavior of the scripts 
and binary should be the same).

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Exit codes reference for httpd binary

Posted by Joshua Slive <jo...@slive.ca>.
On 9/4/07, Fermín Galán Márquez <fe...@cttc.es> wrote:
> Hi,
>
> I would like to know if there is a reference of the "exit codes" of the
> httpd binary (apache2 in the Debian distribution I'm using). After
> browsing at http://httpd.apache.org/docs/2.2/ (and specially
> http://httpd.apache.org/docs/2.2/programs/httpd.html), I haven't found
> any document that describe the topic, so I come to the list in the hope
> of someone could help me, please :)
>
> Maybe it sound a estrange question, but I'm trying to debug a complex
> utilization of the apache2ctl script. The httpd binary is failing to
> start (returning 141 instead of the usual 0) and I'm wondering why...
>
> Thank you very much in advance!

The server itself just issues 0 for success and 1 for failure as far
as I know. apachectl has some other codes documented in comments at
the top of the script.

I don't know where 141 would be coming from. Do you get any
interesting error messages at the prompt or in the error log? If not,
try running httpd under strace or the equivalent.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org