Mailing List Archive

nessusd defunct procs fix
under load, we've seen nessusd leave a number of defunct processes.
we're proposing that wait_for_children() in pluginlaunch.c be changed
from:


void
wait_for_children(int sig)
{
int i;
for(i = 0 ; i < MAX_PROCESSES ; i ++)
{
int ret;
if(processes[i].pid != 0)
{
do {
ret = waitpid(processes[i].pid, NULL, WNOHANG);
} while(ret < 0 && errno == EINTR);
}

}
}



to

void
wait_for_children(int sig)
{
(void) waitpid(-1, NULL, WNOHANG);
}


the exit status of children seems to be ignored, and collecting the exit
status for any child, rather than just those on the list, appears to
stop the defunct processes from appearing.

jeff
Re: nessusd defunct procs fix [ In reply to ]
On Wed, Sep 15, 2004 at 09:20:25AM -0400, Jeff Murphy wrote:
> under load, we've seen nessusd leave a number of defunct processes.
> we're proposing that wait_for_children() in pluginlaunch.c be changed
> from:

That's a good idea. However, I'd prefer to change it to multiple calls
to waitpid(), just in case more than one child exits.

I'll commit such a change in the 2.1.x tree.



-- Renaud
Re: nessusd defunct procs fix [ In reply to ]
On Wed, 2004-09-15 at 16:41 +0200, Renaud Deraison wrote:
> On Wed, Sep 15, 2004 at 09:20:25AM -0400, Jeff Murphy wrote:
> > under load, we've seen nessusd leave a number of defunct processes.
> > we're proposing that wait_for_children() in pluginlaunch.c be changed
> > from:
>
> That's a good idea. However, I'd prefer to change it to multiple calls
> to waitpid(), just in case more than one child exits.
>

good idea.

> I'll commit such a change in the 2.1.x tree.
>

thanks.