For this one, we already have configure support to set
#define HAVE_GETOPT_NEEDS_POSIXLY_CORRECT 1
in platform_defs.h, but then we don't seem to use it any place in the
code (!!).
I suggest if this is set in the build, then pmcd should force the
setting of POSIXLY_CORRECT in its own env before launching any pmdas.
ps. Changing the semantics of getopt() to pander to laziness is a piece
of gnu pixie brain fart that should have killed at birth!
On Fri, 2009-01-30 at 21:23 +1100, Nathan Scott wrote:
> ...
> I had occassion to attempt a pmdasummary deployment the other
> day - looks like its not too happy on Linux. First thing I
> came across was an issue related to the funky GNU getopts(3)
> behaviour, where it will reorder options on the command line.
>
> So, a pmcd.conf line like:
> summary 27 pipe binary
> /var/lib/pcp/pmdas/summary/pmdasummary -d
> 27 /usr/bin/pmie -x -t 5 /var/lib/pcp/pmdas/summary/expr.pmie
>
> ends up passing the pmie options into pmdasummary, I think.
> Worked around that adding a "--" after -d 27, but still no
> go - not sure whats going wrong next, but we still quickly
> exit from the PMDA/pmie, and pmcd cleans up.
>
> The first we can workaround with either having pmcd force a
> POSIXLY_CORRECT into its env, or the install script could
> add the "--" (any preferences there?). I've not cracked the
> last bit of the puzzle yet though (reproducible in dbpmda) -
> a job for next week.
>
> cheers.
>
> --
> Nathan
>
|