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
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