Hi Ken,
I'm puzzled by the need for the change below, as I've not been
seeing this message (and hence, no QA fallout for me). What
was the full error message string you saw here? (or errno?)
Is it EPERM? EACCESS? The idea was that pmie would quietly
continue on its way in these situations, without exporting the
stats file - just want to make sure we are doing that right.
(ie perhaps we need to check for errnos in addition to EEXIST,
which appears to be doing the trick for me but not for you?).
thanks!
commit 6717436693b165a1a5401d3577e078a2a5aa0cc8
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Mon Feb 17 14:47:24 2014 +1100
pmie - quieten warning after tmp dir perms change
After recent changes to the mode and ownership of the
$PCP_VAR_DIR/tmp directory, the message "... warning cannot create
stats file dir ..." may be emitted each time pmie is run as a
user other than "pcp".
This happens a LOT in QA.
Since the message is only a warning, and the only side-effect is
that the pmie process is not visible in the instance domain of
the pmcd.pmie metrics (it is likely that no one but kenj cares!),
I've suppressed the message unless one of the pmie verbose flags
is set (-v, -V or -W).
diff --git a/src/pmie/src/pmie.c b/src/pmie/src/pmie.c
index 0ed8e5f..29198ed 100644
--- a/src/pmie/src/pmie.c
+++ b/src/pmie/src/pmie.c
@@ -331,7 +331,7 @@ startmonitor(void)
snprintf(pmie_dir, sizeof(pmie_dir), "%s%c%s",
pmGetConfig("PCP_TMP_DIR"), __pmPathSeparator(), PMIE_SUBDIR);
if (mkdir2(pmie_dir, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
- if (oserror() != EEXIST) {
+ if (oserror() != EEXIST && verbose) {
fprintf(stderr, "%s: warning cannot create stats file dir %s: %s\n",
pmProgname, pmie_dir, osstrerror());
}
--
Nathan
|