pcp
[Top] [All Lists]

Re: [pcp] Postfix PMDA

To: chandana@xxxxxxxxxxxxx
Subject: Re: [pcp] Postfix PMDA
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 26 May 2014 18:39:08 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx, Keith Owens <keith.owens@xxxxxxxxxxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5383A589.9080006@xxxxxxxxxxxxx>
References: <5383A589.9080006@xxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: kNXOwK3gNFsZE7n0yWmmhCxLH267rA==
Thread-topic: Postfix PMDA
Hi Chandana,

----- Original Message -----
> Hello All,
> 
> The Postfix PMDA uses qshape(1) to gather postfix queue stats, by
> reading files the various postfix queue directories.
> 
> The problem is that all of the postfix queues are only readable by the
> postfix user (or root).
> 
> Since the postfix pmda (by default) is run under the user pcp, it cannot
> gather the necessary stats.
> 
> I suspect that the postfix pmda worked correctly when pcp ran as root.
> 
> Is there anyway we can make the postfix (or any) pmda run as root ?
> 

All daemon PMDAs start out their life as root, and explicitly switch to
some less privileged user; sounds like we need the following patch, can
you try it and let me know if it works for you?

diff --git a/src/pmdas/postfix/pmdapostfix.pl b/src/pmdas/postfix/pmdapostfix.pl
index e6720ec..acce254 100644
--- a/src/pmdas/postfix/pmdapostfix.pl
+++ b/src/pmdas/postfix/pmdapostfix.pl
@@ -211,7 +211,7 @@ $pmda->add_indom($postfix_sent_indom, \@postfix_sent_dom, 
'', '');
 $pmda->add_indom($postfix_received_indom, \@postfix_received_dom, '', '');
 $pmda->add_tail($logfile, \&postfix_log_parser, 0);
 $pmda->set_fetch_callback(\&postfix_fetch_callback);
-$pmda->set_user('pcp');
+$pmda->set_user('postfix');
 $pmda->run;
 
 =pod


cheers.

--
Nathan

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