pcp
[Top] [All Lists]

Re: [pcp] PCP Updates: Allow Connection to PMCD via Unix Domain Sockets

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] PCP Updates: Allow Connection to PMCD via Unix Domain Sockets
From: Dave Brolley <brolley@xxxxxxxxxx>
Date: Wed, 17 Jul 2013 12:40:56 -0400
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1296992588.2315051.1374019697318.JavaMail.root@xxxxxxxxxx>
References: <51D5E449.7010304@xxxxxxxxxx> <1032942944.13639792.1373005231784.JavaMail.root@xxxxxxxxxx> <51DAD4FE.30408@xxxxxxxxxx> <51E33482.4050801@xxxxxxxxxx> <2109826205.1342704.1373931754469.JavaMail.root@xxxxxxxxxx> <51E5C15C.8060909@xxxxxxxxxx> <135512786.2314042.1374018979091.JavaMail.root@xxxxxxxxxx> <1296992588.2315051.1374019697318.JavaMail.root@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
On 07/16/2013 08:08 PM, Nathan Scott wrote:
One other thing I forgot to check into - why are we getting "Permission
Denied" in the first place?!?

Auditing the pmdalinux code, I believe the only way this can be happening
for these filesys metrics is this snippet of code in the fetch callback:
(src/pmdas/linux/pmda.c line# ~4700)

             sbuf = &fs->stats;
             if (!(fs->flags & FSF_FETCHED)) {
                 if (statfs(fs->path, sbuf) < 0)
                     return -oserror();
                 fs->flags |= FSF_FETCHED;
             }

I bet you have some paths that cannot be accessed using statfs(2) via the
"pcp" user?  Even under "normal" conditions - not just during the test.
The list of fs->path entries comes from filesys.c::refresh_filesys() -
its looking over the /proc/mounts entries.

Can you see anything in /proc/mounts that would be causing this?  The df
command uses statfs too, but strace there says its using /etc/mtab - I'd
be interested to see if it gets EACCESS on your box?  (strace FTW).
On my box /etc/mtab is a symlink to /proc/mounts.
/proc/mounts is a symlink to /proc/self/mounts
/proc is globally searchable, as is /proc/self
/proc/self/mounts has perms 444 brolley brolley which makes is globally readable.

> sudo strace -u pcp df
[ ... ]
open("/etc/mtab", O_RDONLY|O_CLOEXEC)   = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f878963f000
read(3, "rootfs / rootfs rw 0 0\nproc /pro"..., 1024) = 1024
read(3, "/cgroup/memory cgroup rw,nosuid,"..., 1024) = 1024
read(3, "e-daemon /run/user/brolley/gvfs "..., 1024) = 311
read(3, "", 1024)                       = 0
close(3)                                = 0

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