Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Nessus: devel

nessusd defunct procs fix

 

 

Nessus devel RSS feed   Index | Next | Previous | View Threaded


jcmurphy at oss

Sep 15, 2004, 6:20 AM

Post #1 of 3 (786 views)
Permalink
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


deraison at nessus

Sep 15, 2004, 7:41 AM

Post #2 of 3 (720 views)
Permalink
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


jcmurphy at oss

Sep 15, 2004, 11:21 AM

Post #3 of 3 (740 views)
Permalink
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.

Nessus devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.