diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2014-08-14 13:06:26 -0700 |
---|---|---|
committer | Harshavardhana <harsha@harshavardhana.net> | 2014-09-03 11:01:45 -0700 |
commit | 025ae07850375cbf981ed335a4ddf702d54be6e3 (patch) | |
tree | a119246764dc98f0d0c7fb87572cd1b01bc18684 /xlators/mgmt/glusterd | |
parent | 845d6c76701a3de6a11b76b004176971411c714e (diff) |
build: make GLUSTERD_WORKDIR rely on localstatedir
Backport from master branch - http://review.gluster.org/#/c/8246/
- Break-way from '/var/lib/glusterd' hard-coded previously,
instead rely on 'configure' value from 'localstatedir'
- Provide 's/lib/db' as default working directory for gluster
management daemon for BSD and Darwin based installations
- loff_t is really off_t on Darwin
- fix-off the warnings generated by clang on FreeBSD/Darwin
- Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all
platforms.
- Define proper environment for running tests, define correct PATH
and LD_LIBRARY_PATH when running tests, so that the desired version
of glusterfs is used, regardless where it is installed.
(Thanks to manu@netbsd.org for this additional work)
Change-Id: I06e684ac4c26d1e74c9daf76753403ad15f79276
BUG: 1130308
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8486
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/Makefile.am | 11 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-hooks.c | 1 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 1 |
4 files changed, 7 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am index 7f3e8ddd88f..c149f64e546 100644 --- a/xlators/mgmt/glusterd/src/Makefile.am +++ b/xlators/mgmt/glusterd/src/Makefile.am @@ -41,10 +41,9 @@ AM_LDFLAGS = -L$(xlatordir) CLEANFILES = install-data-hook: - -if GF_INSTALL_VAR_LIB_GLUSTERD - $(mkdir_p) $(localstatedir)/lib/ - (stat $(sysconfdir)/glusterd && \ - mv $(sysconfdir)/glusterd $(localstatedir)/lib/) || true; - (ln -sf $(localstatedir)/lib/glusterd $(sysconfdir)/glusterd) || true; +if GF_INSTALL_GLUSTERD_WORKDIR + $(mkdir_p) $(DESTDIR)$(GLUSTERD_WORKDIR) + (stat $(DESTDIR)$(sysconfdir)/glusterd && \ + mv $(DESTDIR)$(sysconfdir)/glusterd $(DESTDIR)$(GLUSTERD_WORKDIR)) || true; + (ln -sf $(DESTDIR)$(GLUSTERD_WORKDIR) $(sysconfdir)/glusterd) || true; endif diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c index 2d402b0dd56..f36764e4832 100644 --- a/xlators/mgmt/glusterd/src/glusterd-hooks.c +++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c @@ -260,6 +260,7 @@ glusterd_hooks_add_op_args (runner_t *runner, glusterd_op_t op, case GD_OP_SET_VOLUME: ret = glusterd_hooks_set_volume_args (op_ctx, runner); + glusterd_hooks_add_working_dir (runner, priv); break; case GD_OP_GSYNC_CREATE: diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index adf58cc7dde..559b39d8d84 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1210,7 +1210,7 @@ init (xlator_t *this) first_time = 1; } - setenv ("GLUSTERD_WORKING_DIR", workdir, 1); + setenv ("GLUSTERD_WORKDIR", workdir, 1); gf_log (this->name, GF_LOG_INFO, "Using %s as working directory", workdir); diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index ec036f8cf06..16745688868 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -463,7 +463,6 @@ enum glusterd_vol_comp_status_ { GLUSTERD_VOL_COMP_RJT, }; -#define GLUSTERD_DEFAULT_WORKDIR "/var/lib/glusterd" #define GLUSTERD_DEFAULT_PORT GF_DEFAULT_BASE_PORT #define GLUSTERD_INFO_FILE "glusterd.info" #define GLUSTERD_VOLUME_QUOTA_CONFIG "quota.conf" |