pcp
[Top] [All Lists]

RE: Yet another Python snarfoo

To: "'PCP'" <pcp@xxxxxxxxxxx>
Subject: RE: Yet another Python snarfoo
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Sun, 6 Mar 2016 08:26:38 +1100
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <56D627B6.6000900@xxxxxxxxxxxxxxxx>
References: <56D627B6.6000900@xxxxxxxxxxxxxxxx>
Thread-index: AQLvqQLv/fNB2KVOfunHCyODAhCp750O34vQ
I've been beating my head against this brick wall for a few days, and would 
really like some pain relief ...

> -----Original Message-----
> From: Ken McDonell [mailto:kenj@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, 2 March 2016 10:37 AM
> To: PCP <pcp@xxxxxxxxxxx>
> Subject: Yet another Python snarfoo
> ...
> On Mac OS X we've carefully moved PCP artifacts out of /usr to avoid
> installer issues ... this has be necessary on some of the *BSD
> platforms also, so this is not confined to Mac OS X (although that's
> where I'm battling with it at present).
> ...
> As a consequence ...
> ...
> 2. Because pcp(1) is not in /usr/bin on these platforms, none of the
> following will work in a fit:
> 
> src/pmclient/pmclient_fg.python:#! /usr/bin/pcp python
> ...

The problem is worse than this ... on Mac OS X, shebang (#!) only works if the 
next argument is an executable binary (and not a shell scripts like pcp(1)) ... 
I have days of bloody evidence to support this claim.

When I eventually discovered this I wrote pmpython.c to run $PCP_PYTHON_PROG 
from the env or pcp.conf and changed a couple of the Python scripts to use

        #!/usr/bin/env pmpython

which demonstrably works.

Anyone see a problem with globally replacing the existing #!/usr/bin/pcp python 
with the above for Python scripts in PCP?

<Prev in Thread] Current Thread [Next in Thread>