nessusd defunct procs fix
Jeff Murphy <[email protected]> Wed, 15 Sep 2004 09:20:25 -0400
| Newsgroups | gmane.comp.security.nessus.devel |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
Nessus-devel mailing list
[email protected]
http://mail.nessus.org/mailman/listinfo/nessus-devel