[Nagiosplug-devel] check_dns: DNS WARNING - nslookup returned error status

Ton Voon ton.voon at altinity.com
Fri Sep 2 05:04:13 CEST 2005


Sean,

I've been investigating this issue this morning and it's getting  
quite disturbing.

My feeling is that this is a red hat problem. My colleague has access  
to a RHEL4 server (2.6.8 kernel) and gets this problem occasionally  
too. I can also reproduce the error consistently if I set "signal  
(SIGCHLD, SIG_IGN)" in check_dns.c.

So this appears to happen if a process finishes before the parent  
issues a waitpid. But in normal behaviour, a process always stays in  
a zombie state until the waitpid is issued. To answer your specific  
question below, you therefore cannot get the exit status of the child  
because it has already been reaped.

Searching on the web, it appears there was some patch made around  
ECHILD errors: http://www.redhat.com/archives/fedora-announce-list/ 
2005-January/msg00004.html (search for ECHILD). Dag, I would  
appreciate if you can confirm if you have this patch and that you  
still get the errors.

I've also found rant about how Redhat have inconsistent behaviour  
around this area: http://listgateway.unipi.it/pipermail/ntop-dev/2003- 
April/002625.html. This is interesting to note because ntop also use  
a secure_popen mechanism to make external calls. I'm going to look  
through their current code to see if there are any fixes around here.

I'm not keen on the patch because it seems to be just ignoring some  
peculiar behaviour. I think there is more to this problem than meets  
the eye.

Ton

On 2 Sep 2005, at 12:24, sean finney wrote:

> now, a question about this patch...
>
> the code in question:
>
> ==
>     while (waitpid (pid, &status, 0) < 0)
>     {
>         if (errno == ECHILD)
>             return (0);                         /* Child has  
> already exited */
>
>         if (errno != EINTR)
>             return (1);                         /* error other than  
> EINTR from waitpid() */
>     }
>
>     if (WIFEXITED (status))
>         return (WEXITSTATUS (status));  /* return child's  
> termination status */
>
>     return (1);
> ==
>
> does this remove the check for the child's exit status?
>
>
>
>     sean
>





http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon

The contents of this email and any files transmitted with it are
confidential and intended solely for the use of the individuals to  
whom it
is addressed. If you are not the intended recipient or have received  
this
e-mail in error please notify the sender and destroy this e-mail
immediately. Any unauthorised copying, disclosure or distribution of the
material in this e-mail is strictly prohibited.







More information about the Devel mailing list