summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-28 05:17:27 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-28 04:50:33 -0700
commita381d3a29fc149d78aecba22fdb285314aa9b711 (patch)
treeb5014a9a960503b7ce9c3af3d06536bbf096a460
parenta89ec9419758b420ce11dddac27327ec34141da6 (diff)
glusterd: logs is a symlink to default var log dir
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1728 (glusterd log file location) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1728
-rw-r--r--xlators/mgmt/glusterd/src/Makefile.am3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am
index 81e542d65f3..e13742a661d 100644
--- a/xlators/mgmt/glusterd/src/Makefile.am
+++ b/xlators/mgmt/glusterd/src/Makefile.am
@@ -15,7 +15,8 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h glusterd-sm.h \
AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS)\
-I$(top_srcdir)/libglusterfs/src -shared -nostartfiles $(GF_CFLAGS)\
-I$(rpclibdir) -L$(xlatordir)/ -I$(CONTRIBDIR)/rbtree -I$(top_srcdir)/rpc/xdr/src\
- -I$(top_srcdir)/rpc/rpc-lib/src -I$(CONTRIBDIR)/uuid -DGFS_PREFIX=\"$(prefix)\"
+ -I$(top_srcdir)/rpc/rpc-lib/src -I$(CONTRIBDIR)/uuid -DGFS_PREFIX=\"$(prefix)\" \
+ -DDATADIR=\"$(localstatedir)\"
CLEANFILES =
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 0003fbef519..c9db4b09d8d 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -307,10 +307,10 @@ init (xlator_t *this)
}
snprintf (voldir, PATH_MAX, "%s/logs", dirname);
- ret = mkdir (voldir, 0777);
+ ret = symlink (DEFAULT_LOG_FILE_DIRECTORY, voldir);
if ((-1 == ret) && (errno != EEXIST)) {
gf_log (this->name, GF_LOG_CRITICAL,
- "Unable to create logs directory %s"
+ "Unable to create symlink to logs directory %s"
" ,errno = %d", voldir, errno);
exit (1);
}
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index ac30d3e5c38..9769a95ad2b 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -48,7 +48,7 @@
#define GLUSTERD_MAX_VOLUME_NAME 1000
-
+#define DEFAULT_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
struct glusterd_store_iter_ {
int fd;