pcp
[Top] [All Lists]

Re: [pcp] minimal install not-as-root

To: Mark Potts <potts@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [pcp] minimal install not-as-root
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 29 Jul 2014 23:29:20 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <53D85DD1.6030009@xxxxxxxxxxxxxxxxxxx>
References: <53D85DD1.6030009@xxxxxxxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: eKOPh+CfBJXpxjqhy9Rbv3R0cxUM4A==
Thread-topic: minimal install not-as-root
Hi Mark,

----- Original Message -----
> Hi,
> I have a working C++/Linux application that as a side-function
> collects/consumes some PCP perf data using libpcp library
> functions.
> 
> A new imposed requirement is that my application and any
> libraries/daemons that it uses are to be installed on a group
> of clustered VMs but the installer can not act as root during
> the installation. Is it possible to to create a stripped-down
> PCP version that could be installed and operated without
> root privileges ?
> 
> If so, is the logical starting point a source distro or (preferably)
> a Centos-built rpm, from which I can extract components
> with rpm2cpio? Perhaps a minimal set that includes pmcd,
> libpcp, and related dependencies with a user-level pmcd startup.
> 
> I'd be happy to provide feedback on my efforts, if successful;
> but I don't even want to begin if there is a brick wall in my
> path.

I don't think there's a brick wall, you should be able to get this
to work.  And, yep, I'd be interested to hear how it goes.

If the only thing you need are values/metadata for metrics, and if
those metrics are available from PMDAs that function in DSO form,
you might not even need to get pmcd up and running.  You should be
able to use the PM_LOCAL_CONTEXT mode using just libpcp and the
DSO PMDA(s) - e.g. pmda_linux.so - from whence your metrics are
sourced.  See the pmNewContext(3) man page & the -L and -K options
to pminfo(1).

If you do need pmcd (clustered VMs? might be using the distributed
PCP protocol?), you should be able to fire it up with PCP_USER and
PCP_GROUP in your environment - it will attempt to change user/group
to these early on in its life.  Usually it sources these variables
from /etc/pcp.conf but environment varibables can override this.
You might find the PCP_DIR environment variable handy too.

Of course, if you have metrics/PMDAs that need to run in privileged
mode to extract their metrics data... then you're in strife :)  All
the Linux kernel PMDA metrics can nowadays be accessed unprivileged
though.

Good luck!

--
Nathan

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