i use both pre-generate.sh and post-generate.sh (for creating timestamps
that get ftp'ed with the generated files, from which a cron job hourly
checks the timestamp, in an attempt to have some sort of end-to-end
automated test in place)
in htmlgenerator/html.c, i changed from existing:
while (waitpid(-1, NULL, WNOHANG) == 0)
{
radUtilsSleep(5);
}
to
while (waitpid(-1, NULL, WNOHANG) > 0)
;
and i'm not getting zombies any more
my reasoning:
the original code would flush only one zombie per entry into
defaultHandler because that zombie's PID would be returned by waitpid
(i.e. not 0).
and if there weren't any zombies, waitpid would return 0 because of the
shadow child process radlib creates - so it should gently spin around
radUtilsSleep(5) until a child process terminated then flush exactly one
zombie and exit the loop
if this theory is correct, then anyone using just one of pre-generate.sh
| post-generate.sh | emailNotification should see between zero and one
htmlgend zombies at any given time but no more than that, but using two
or more of those would lead to runaway zombies (hmm, michael jackson's
thriller comes to mind..)
in htmlgenerator/html.c, i also changed:
signal (signum, defaultSigHandler);
to
radProcessSignalCatch (signum, defaultSigHandler);
as it is ambiguous to mix calls to sigaction (called from
radProcessSignalCatch) with calls to signal
i continue to be impressed with how solid & resilient wview is
------------------------------------------------------------------------
*Graham Eddy*
Quoting Graham Eddy <graha...@gmail.com>:
> if this theory is correct, then anyone using just one of pre-generate.sh
> | post-generate.sh | emailNotification should see between zero and one
> htmlgend zombies at any given time but no more than that, but using two
> or more of those would lead to runaway zombies
# top
top - 11:53:20 up 12 days, 4:40, 1 user, load average: 1.48, 1.96, 1.94
Tasks: 300 total, 1 running, 291 sleeping, 0 stopped, 8 zombie
Cpu0 : 71.6%us, 17.6%sy, 0.0%ni, 10.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 14.7%us, 2.0%sy, 0.0%ni, 82.4%id, 0.0%wa, 0.0%hi, 1.0%si, 0.0%st
Mem: 3886940k total, 3795004k used, 91936k free, 473964k buffers
Swap: 8193140k total, 192k used, 8192948k free, 2123520k cached
Oh yes, I can sing a song 'bout those zombies. 8 zombies are not very
much, on some days there ahre 'bout hundrets. ;(
Restarting wview helps a few days ...
I'm using:
/usr/local/etc/wview/post-generate.sh
and
emailNotification
I'll disable eMAilnotification and report what happens, if your theory
is right
Pfiade,
Django
--
"Bonnie & Clyde der Postmaster-Szene!" approved by Postfix-God
http://wetterstation-pliening.info
http://dokuwiki.nausch.org
rather than disabling some facilities, just apply the waitpid()>0 code
change
------------------------------------------------------------------------
*Graham Eddy*
we can try more complex approaches if more corner cases appear
------------------------------------------------------------------------
*Graham Eddy*