There is a serious problem with the perl pmdas ... first noticed with qa
162 where the qa controlling script (check) receives a SIGTERM when the
qa test is run!!!
Tracked down to the news pmda install.
Further digging shows a we end up here
/* take out any children we created */
__pmProcessTerminate(0, 0);
in the cpan/local.c code.
Now over in libpcp this translates to ... kill(0, SIGTERM) ... which on
Linux takes out the whole process group (not the children) ... BANG.
Now kill(0, ...) is sufficiently evil that I have a good mind to guard
against that in libpcp, especially since the only other user of this is
pmcd who would appear to have a real process id to use as the first
argument.
Based on an almost total lack on perl knowledge, the perl code needs to
either (a) keep track of spawned children pids and destroy them
explicitly, or (b) detach itself into its own process group so
kill(0,..) is safe.
But, even (b) does not work, because if kill(0,...) is confined to a new
process group for just the pmda, this will still whack the pmda with a
SIGTERM ... and that means things like stdio buffers don't get
flushed ... so these parts of the installation script
PCP_PERL_DOMAIN=1 perl /var/lib/pcp/pmdas/news/pmdanews.pl
and
PCP_PERL_PMNS=1 perl /var/lib/pcp/pmdas/news/pmdanews.pl
produce zero length files domain.h and pmns files and the install fails
miserably.
So, I've gone ahead with the attached patch to libpcp/src/util.c and
leave the perl bog to someone who knows better ... 8^)>
eek
Description: Text Data
|