This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gather - Metric Data Gatherer".
The branch, master has been updated
via 506e4567a3ee40d313525a09e67f1a294aedd368 (commit)
from 55cb9dc8aa7ac8169aaec28433bacd986562d292 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 506e4567a3ee40d313525a09e67f1a294aedd368
Author: Dave Heller <hel...@us...>
Date: Fri Aug 21 11:42:58 2015 -0400
Fixed #2744: create run directory if it does not exist
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 3 +++
NEWS | 1 +
comms/mcserv_unix.c | 11 +++++++++++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9e3ff19..1cd4974 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+No longer maintaining Changlog for v2.2.10 and forward, use 'git log' instead.
+
+
2014-10-06 Dave Heller <hel...@us...>
* NEWS, gather.c, gatherd.c, plugin/repositoryUnixProcess.c, repos.c
diff --git a/NEWS b/NEWS
index 65c8aff..c783e53 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Changes in Version 2.2.10
=========================
Bugs fixed:
+- #2744 gatherer should create run directory if it does not exist
Features added:
diff --git a/comms/mcserv_unix.c b/comms/mcserv_unix.c
index 65958f0..2ba7ed3 100644
--- a/comms/mcserv_unix.c
+++ b/comms/mcserv_unix.c
@@ -25,6 +25,7 @@
#include <sys/un.h>
#include <sys/file.h>
#include <sys/poll.h>
+#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -50,6 +51,7 @@ int mcs_init(const char *commid)
{
struct sockaddr_un sa;
struct sigaction sigact;
+ struct stat buf;
if (commhandle==-1) {
commhandle=socket(PF_UNIX,SOCK_STREAM,0);
@@ -59,6 +61,15 @@ int mcs_init(const char *commid)
strerror(errno));
return -1;
}
+ if (stat(GATHER_RUNDIR, &buf) || !(buf.st_mode & S_IFDIR)) {
+ if (mkdir(GATHER_RUNDIR, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) {
+ m_log(M_ERROR,M_SHOW,
+ "mcs_init: could not create run directory %s: %s\n",
+ GATHER_RUNDIR,
+ strerror(errno));
+ return -1;
+ }
+ }
if (fdlockfile == -1) {
if (snprintf(lockname,PATH_MAX+2,MC_LOCKFILE,commid) >
PATH_MAX) {
hooks/post-receive
--
gather - Metric Data Gatherer
|