pcp
[Top] [All Lists]

Re: [pcp] Postfix PMDA

To: Nathan Scott <nathans@xxxxxxxxxx>, "chandana@xxxxxxxxxxxxx" <chandana@xxxxxxxxxxxxx>
Subject: Re: [pcp] Postfix PMDA
From: Keith Owens <keith.owens@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 May 2014 10:31:39 +1000
Cc: "pcp@xxxxxxxxxxx" <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1388655205.15167122.1401143948270.JavaMail.zimbra@xxxxxxxxxx>
References: <5383A589.9080006@xxxxxxxxxxxxx> <1388655205.15167122.1401143948270.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
Thanks Nathan, that works fine.

(yes, that Keith Owens)

On 27/05/14 08:39, Nathan Scott wrote:https://svn.m4u.com.au/repos/neo/platform/puppet/branches/PLAT-302
Hi Chandana,

----- Original Message -----
Hello All,https://svn.m4u.com.au/repos/neo/platform/puppet/branches/PLAT-302

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>