diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2014-06-29 18:56:44 -0700 |
---|---|---|
committer | Harshavardhana <harsha@harshavardhana.net> | 2014-08-07 01:17:29 -0700 |
commit | 2ec6ea43f2ddc6c00a030be6d04c00f0924277b7 (patch) | |
tree | b2d98cd8c4760c1af44c8b6a70661fe5566ce6da | |
parent | f29da9bcc812e3d0711005ce86051d70c277a165 (diff) |
build: make GLUSTERD_WORKDIR rely on localstatedir
- 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: I2339a0d9275de5939ccad3e52b535598064a35e7
BUG: 1111774
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8246
Tested-by: Gluster Build System <jenkins@build.gluster.com>
71 files changed, 341 insertions, 265 deletions
diff --git a/.gitignore b/.gitignore index 2a986c13ff5..fad3fb794ee 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ install-sh ltmain.sh Makefile.in missing +test-driver *compile *.gcda *.gcno @@ -29,9 +30,14 @@ log *.vol # Generated files +tests/env.rc +dht_layout_unittest +mem_pool_unittest +tests/utils/arequal-checksum api/examples/__init__.py api/examples/__init__.py? api/examples/setup.py +xlators/features/glupy/src/__init__.py contrib/argp-standalone/libargp.a contrib/uuid/uuid_types.h extras/init.d/glusterd-Debian @@ -44,6 +50,8 @@ extras/ocf/glusterd extras/ocf/volume extras/who-wrote-glusterfs/gitdm extras/geo-rep/gsync-sync-gfid +geo-replication/src/set_geo_rep_pem_keys.sh +geo-replication/syncdaemon/configinterface.py glusterfs-api.pc glusterfs.spec glusterfsd/src/glusterfsd diff --git a/build-aux/xdrgen b/build-aux/xdrgen index c2a7a781d58..0cefc9b4890 100755 --- a/build-aux/xdrgen +++ b/build-aux/xdrgen @@ -27,6 +27,9 @@ append_licence_header () #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #pragma GCC diagnostic ignored "-Wunused-variable" #endif +#else +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-value" #endif #endif #endif diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am index 923600fbde2..434122b2a78 100644 --- a/cli/src/Makefile.am +++ b/cli/src/Makefile.am @@ -4,10 +4,10 @@ gluster_SOURCES = cli.c registry.c input.c cli-cmd.c cli-rl.c \ cli-cmd-volume.c cli-cmd-peer.c cli-rpc-ops.c cli-cmd-parser.c\ cli-cmd-system.c cli-cmd-misc.c cli-xml-output.c cli-quotad-client.c cli-cmd-snapshot.c -gluster_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_LDADD)\ +gluster_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_LDADD) \ $(RLLIBS) $(top_builddir)/rpc/xdr/src/libgfxdr.la \ $(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \ - $(GF_GLUSTERFS_LIBS) $(XML_LIBS) + $(XML_LIBS) gluster_LDFLAGS = $(GF_LDFLAGS) noinst_HEADERS = cli.h cli-mem-types.h cli-cmd.h cli-quotad-client.h diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index a0b873d2358..4811293dbb8 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -999,7 +999,6 @@ cli_is_key_spl (char *key) return (strcmp (key, "group") == 0); } -#define GLUSTERD_DEFAULT_WORKDIR "/var/lib/glusterd" static int cli_add_key_group (dict_t *dict, char *key, char *value, char **op_errstr) { @@ -1090,7 +1089,6 @@ out: return ret; } -#undef GLUSTERD_DEFAULT_WORKDIR int32_t cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options, diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 43e696d56c5..c743b8bc9f0 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1222,7 +1222,8 @@ _limits_set_on_volume (char *volname) { /* TODO: fix hardcoding; Need to perform an RPC call to glusterd * to fetch working directory */ - sprintf (quota_conf_file, "/var/lib/glusterd/vols/%s/quota.conf", + sprintf (quota_conf_file, "%s/vols/%s/quota.conf", + GLUSTERD_DEFAULT_WORKDIR, volname); fd = open (quota_conf_file, O_RDONLY); if (fd == -1) @@ -1350,7 +1351,8 @@ cli_cmd_quota_handle_list_all (const char **words, dict_t *options) //TODO: fix hardcoding; Need to perform an RPC call to glusterd //to fetch working directory - sprintf (quota_conf_file, "/var/lib/glusterd/vols/%s/quota.conf", + sprintf (quota_conf_file, "%s/vols/%s/quota.conf", + GLUSTERD_DEFAULT_WORKDIR, volname); fd = open (quota_conf_file, O_RDONLY); if (fd == -1) { diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 187fcc1bee4..ac66b1a5662 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1742,7 +1742,7 @@ gf_cli_set_volume_cbk (struct rpc_req *req, struct iovec *iov, dict_t *dict = NULL; char *help_str = NULL; char msg[1024] = {0,}; - char *debug_xlator = _gf_false; + char *debug_xlator = NULL; char tmp_str[512] = {0,}; if (-1 == req->rpc_status) { diff --git a/configure.ac b/configure.ac index 69c3934c4a2..35d5bb0f372 100644 --- a/configure.ac +++ b/configure.ac @@ -7,13 +7,14 @@ dnl later), or the GNU General Public License, version 2 (GPLv2), in all dnl cases as published by the Free Software Foundation. AC_INIT([glusterfs], - [m4_esyscmd([build-aux/pkg-version --version])], - [gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git]) + [m4_esyscmd([build-aux/pkg-version --version])], + [gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git]) AC_SUBST([PACKAGE_RELEASE], [m4_esyscmd([build-aux/pkg-version --release])]) AM_INIT_AUTOMAKE + # Removes warnings when using automake 1.14 around (...but option 'subdir-objects' is disabled ) #but libglusterfs fails to build with contrib (Then are not set up that way?) #AM_INIT_AUTOMAKE([subdir-objects]) @@ -39,6 +40,7 @@ AC_CONFIG_FILES([Makefile libglusterfs/src/Makefile geo-replication/src/peer_gsec_create geo-replication/src/peer_add_secret_pub + geo-replication/syncdaemon/configinterface.py glusterfsd/Makefile glusterfsd/src/Makefile rpc/Makefile @@ -52,8 +54,8 @@ AC_CONFIG_FILES([Makefile rpc/xdr/Makefile rpc/xdr/src/Makefile xlators/Makefile - xlators/meta/Makefile - xlators/meta/src/Makefile + xlators/meta/Makefile + xlators/meta/src/Makefile xlators/mount/Makefile xlators/mount/fuse/Makefile xlators/mount/fuse/src/Makefile @@ -169,6 +171,7 @@ AC_CONFIG_FILES([Makefile cli/src/Makefile doc/Makefile extras/Makefile + extras/glusterd.vol extras/init.d/Makefile extras/init.d/glusterd.plist extras/init.d/glusterd-Debian @@ -687,7 +690,14 @@ if test "x${have_backtrace}" = "xyes"; then fi AC_SUBST(HAVE_BACKTRACE) -AC_CHECK_LIB([m], [ceil], , AC_MSG_ERROR([glibc math package missing - required])) +if test "x${have_backtrace}" != "xyes"; then +AC_TRY_COMPILE([#include <math.h>], [double x=0.0; x=ceil(0.0);], + [have_math_h=yes], + AC_MSG_ERROR([need math library for libexecinfo])) +if test "x${have_math_h}" = "xyes"; then + LIBS="$LIBS -lm" +fi +fi dnl glusterfs prints memory usage to stderr by sending it SIGUSR1 AC_CHECK_FUNC([malloc_stats], [have_malloc_stats=yes]) @@ -846,21 +856,31 @@ if test "x$ac_cv_header_execinfo_h" = "xno"; then fi fi +### Dirty hacky stuff to make LOCALSTATEDIR work +if test "x$prefix" = xNONE; then + test $localstatedir = '${prefix}/var' && localstatedir=$ac_default_prefix/var + localstatedir=/var + LOCALSTATEDIR=$(eval echo ${localstatedir}) +else + LOCALSTATEDIR=$(eval echo ${localstatedir}) +fi + case $host_os in linux*) GF_HOST_OS="GF_LINUX_HOST_OS" - GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}" + GF_CFLAGS="${GF_COMPILER_FLAGS} ${ARGP_STANDALONE_CPPFLAGS}" GF_LDADD="${ARGP_STANDALONE_LDADD}" GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\"" + GLUSTERD_WORKDIR="${LOCALSTATEDIR}/lib/glusterd" ;; solaris*) GF_HOST_OS="GF_SOLARIS_HOST_OS" GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m64" GF_LDFLAGS="" GF_LDADD="${ARGP_STANDALONE_LDADD}" - GF_GLUSTERFS_LIBS="-lnsl -lresolv -lsocket" BUILD_FUSE_CLIENT=no FUSE_CLIENT_SUBDIR="" + GLUSTERD_WORKDIR="${LOCALSTATEDIR}/lib/glusterd" ;; *netbsd*) GF_HOST_OS="GF_BSD_HOST_OS" @@ -870,39 +890,33 @@ case $host_os in GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\"" GF_LDADD="${ARGP_STANDALONE_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then - GF_GLUSTERFS_LIBS="-lexecinfo" + GF_LDFLAGS="-lexecinfo" fi GF_FUSE_LDADD="-lperfuse" BUILD_FUSE_CLIENT=yes LEXLIB="" BUILD_FUSERMOUNT=no FUSERMOUNT_SUBDIR="" + GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd" ;; *freebsd*) GF_HOST_OS="GF_BSD_HOST_OS" - GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0" + GF_CFLAGS="${GF_COMPILER_FLAGS} ${ARGP_STANDALONE_CPPFLAGS} -O0" GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" GF_CFLAGS="${GF_CFLAGS} -D_LIBGEN_H_" GF_CFLAGS="${GF_CFLAGS} -DO_DSYNC=0" GF_CFLAGS="${GF_CFLAGS} -Dxdr_quad_t=xdr_longlong_t" GF_CFLAGS="${GF_CFLAGS} -Dxdr_u_quad_t=xdr_u_longlong_t" - GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}" GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\"" - GF_FUSE_LIBS="${GF_FUSE_LIBS} /usr/lib/libutil.so" - GF_FUSE_LDADD="-lutil" - GF_CFLAGS=" -I/usr/local/include ${GF_CFLAGS}" - CFLAGS=" -std=gnu89 ${CFLAGS}" - GF_CFLAGS=" -std=gnu89 ${GF_CFLAGS}" - GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}" - GF_LDADD="${ARGP_STANDALONE_LDADD} /usr/local/lib/libpython2.7.so /usr/local/lib/libintl.so" - LDFLAGS="${LDFLAGS} -L/usr/local/lib" + GF_LDADD="${ARGP_STANDALONE_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then - GF_GLUSTERFS_LIBS="-lexecinfo" + GF_LDFLAGS="-lexecinfo" fi + BUILD_FUSE_CLIENT=yes BUILD_FUSERMOUNT=no - BUILD_QEMU_BLOCK=no FUSERMOUNT_SUBDIR="" + GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd" ;; darwin*) GF_HOST_OS="GF_DARWIN_HOST_OS" @@ -918,6 +932,7 @@ case $host_os in BUILD_FUSERMOUNT="no" BUILD_QEMU_BLOCK="no" FUSERMOUNT_SUBDIR="" + GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd" ;; esac @@ -1066,7 +1081,6 @@ dnl Required if cmockery2 headers are not in standar paths GF_CFLAGS="${GF_CFLAGS} ${UNITTEST_CPPFLAGS}" AC_SUBST(GF_HOST_OS) -AC_SUBST([GF_GLUSTERFS_LIBS]) AC_SUBST(GF_CFLAGS) AC_SUBST(GF_LDFLAGS) AC_SUBST(GF_LDADD) @@ -1089,7 +1103,8 @@ AM_CONDITIONAL([GF_LINUX_HOST_OS], test "${GF_HOST_OS}" = "GF_LINUX_HOST_OS") AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS") AM_CONDITIONAL([GF_BSD_HOST_OS], test "${GF_HOST_OS}" = "GF_BSD_HOST_OS") -AM_CONDITIONAL([GF_INSTALL_VAR_LIB_GLUSTERD], test ! -d ${localstatedir}/lib/glusterd && test -d ${sysconfdir}/glusterd ) +AC_SUBST(GLUSTERD_WORKDIR) +AM_CONDITIONAL([GF_INSTALL_GLUSTERD_WORKDIR], test ! -d ${GLUSTERD_WORKDIR} && test -d ${sysconfdir}/glusterd ) dnl pkg-config versioning GFAPI_VERSION="7.0.0" @@ -1109,6 +1124,9 @@ AC_SUBST(LIBGLUSTERFS_LT_VERSION) AC_SUBST(LIBGFCHANGELOG_LT_VERSION) AC_SUBST(GFAPI_LT_VERSION) +dnl this change necessary for run-tests.sh +AC_CONFIG_FILES([tests/env.rc],[ln -s ${ac_abs_builddir}/env.rc ${ac_abs_srcdir}/env.rc 2>/dev/null]) + AC_OUTPUT echo diff --git a/contrib/argp-standalone/configure.ac b/contrib/argp-standalone/configure.ac index 98bedc6f39f..c0867eb5b35 100644 --- a/contrib/argp-standalone/configure.ac +++ b/contrib/argp-standalone/configure.ac @@ -100,6 +100,6 @@ fi CPPFLAGS="$CPPFLAGS -I$srcdir" dnl Added for C99 standards -CFLAGS="$CFLAGS -std=gnu89" +CFLAGS="$CFLAGS -std=gnu89 -static" AC_OUTPUT(Makefile) diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c index a7fd94de464..1edde86014a 100644 --- a/contrib/fuse-lib/mount.c +++ b/contrib/fuse-lib/mount.c @@ -246,14 +246,16 @@ fuse_mount_sys (const char *mountpoint, char *fsname, #ifdef __FreeBSD__ struct iovec *iov = NULL; int iovlen = 0; + char fdstr[15]; + sprintf (fdstr, "%d", fd); + build_iovec (&iov, &iovlen, "fstype", "fusefs", -1); build_iovec (&iov, &iovlen, "subtype", "glusterfs", -1); - build_iovec (&iov, &iovlen, "fspath", mountpoint, -1); + build_iovec (&iov, &iovlen, "fspath", __DECONST(void *, mountpoint), + -1); build_iovec (&iov, &iovlen, "from", "/dev/fuse", -1); build_iovec (&iov, &iovlen, "volname", source, -1); - build_iovec_argf (&iov, &iovlen, "fd", "%d", fd); - build_iovec_argf (&iov, &iovlen, "user_id", "%d", getuid()); - build_iovec_argf (&iov, &iovlen, "group_id", "%d", getgid()); + build_iovec (&iov, &iovlen, "fd", fdstr, -1); ret = nmount (iov, iovlen, mountflags); #else ret = mount (source, mountpoint, fstype, mountflags, diff --git a/contrib/libexecinfo/execinfo_compat.h b/contrib/libexecinfo/execinfo_compat.h index 85f185dd5f7..ae84cfb1f35 100644 --- a/contrib/libexecinfo/execinfo_compat.h +++ b/contrib/libexecinfo/execinfo_compat.h @@ -39,9 +39,9 @@ extern "C" { #endif -int backtrace(void **, int); -char **backtrace_symbols(void *const *, int); -void backtrace_symbols_fd(void *const *, int, int); +extern int backtrace(void **, int); +extern char **backtrace_symbols(void *const *, int); +extern void backtrace_symbols_fd(void *const *, int, int); #ifdef __cplusplus } diff --git a/contrib/qemu/include/sysemu/os-posix.h b/contrib/qemu/include/sysemu/os-posix.h index 25d0b2a73f6..ed8cbaff6a3 100644 --- a/contrib/qemu/include/sysemu/os-posix.h +++ b/contrib/qemu/include/sysemu/os-posix.h @@ -36,7 +36,7 @@ int os_mlock(void); typedef struct timeval qemu_timeval; #define qemu_gettimeofday(tp) gettimeofday(tp, NULL) -#ifndef CONFIG_UTIMENSAT +#if !defined(CONFIG_UTIMENSAT) || defined(__FreeBSD__) #ifndef UTIME_NOW # define UTIME_NOW ((1l << 30) - 1l) #endif diff --git a/contrib/qemu/util/oslib-posix.c b/contrib/qemu/util/oslib-posix.c index 5dceea5f581..77cb9b72d1d 100644 --- a/contrib/qemu/util/oslib-posix.c +++ b/contrib/qemu/util/oslib-posix.c @@ -50,6 +50,7 @@ extern int daemon(int, int); #include <glib/gprintf.h> #include "config-host.h" +#include "qemu-common.h" #include "sysemu/sysemu.h" #include "trace.h" #include "qemu/sockets.h" diff --git a/extras/Makefile.am b/extras/Makefile.am index 9395c9c1b65..74b6d17c16b 100644 --- a/extras/Makefile.am +++ b/extras/Makefile.am @@ -21,6 +21,6 @@ EXTRA_DIST = $(conf_DATA) specgen.scm MacOSX/Portfile glusterfs-mode.el \ command-completion/Makefile command-completion/README install-data-local: - $(mkdir_p) $(DESTDIR)$(localstatedir)/lib/glusterd/groups + $(mkdir_p) $(DESTDIR)$(GLUSTERD_WORKDIR)/groups $(INSTALL_DATA) $(top_srcdir)/extras/group-virt.example \ - $(DESTDIR)$(localstatedir)/lib/glusterd/groups/virt + $(DESTDIR)$(GLUSTERD_WORKDIR)/groups/virt diff --git a/extras/geo-rep/Makefile.am b/extras/geo-rep/Makefile.am index 0cd6b1b7a02..6d3d10b88a0 100644 --- a/extras/geo-rep/Makefile.am +++ b/extras/geo-rep/Makefile.am @@ -5,7 +5,7 @@ scripts_DATA = gsync-upgrade.sh generate-gfid-file.sh get-gfid.sh \ scripts_PROGRAMS = gsync-sync-gfid gsync_sync_gfid_CFLAGS = $(GF_CFLAGS) -Wall -I$(top_srcdir)/libglusterfs/src gsync_sync_gfid_LDFLAGS = $(GF_LDFLAGS) -gsync_sync_gfid_LDADD = $(GF_LIBS) $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_GLUSTERFS_LIBS) +gsync_sync_gfid_LDADD = $(GF_LIBS) $(top_builddir)/libglusterfs/src/libglusterfs.la gsync_sync_gfid_SOURCES = gsync-sync-gfid.c EXTRA_DIST = gsync-sync-gfid.c gsync-upgrade.sh generate-gfid-file.sh \ diff --git a/extras/glusterd.vol b/extras/glusterd.vol.in index fe2e3e2c772..690dbe71823 100644 --- a/extras/glusterd.vol +++ b/extras/glusterd.vol.in @@ -1,6 +1,6 @@ volume management type mgmt/glusterd - option working-directory /var/lib/glusterd + option working-directory @GLUSTERD_WORKDIR@ option transport-type socket,rdma option transport.socket.keepalive-time 10 option transport.socket.keepalive-interval 2 diff --git a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh index 1866f6abd7e..d18367fc9df 100755 --- a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh +++ b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh @@ -18,7 +18,7 @@ PROGNAME="Quota-xattr-heal-add-brick" VOL_NAME= VERSION= VOLUME_OP= -GLUSTERD_WORKING_DIR= +GLUSTERD_WORKDIR= ENABLED_NAME="S28Quota-root-xattr-heal.sh" @@ -45,33 +45,33 @@ eval set -- "$ARGS" while true; do - case $1 in + case $1 in --volname) - shift - VOL_NAME=$1 - ;; + shift + VOL_NAME=$1 + ;; --version) - shift - VERSION=$1 - ;; - --gd-workdir) - shift - GLUSTERD_WORKING_DIR=$1 - ;; - --volume-op) - shift - VOLUME_OP=$1 - ;; + shift + VERSION=$1 + ;; + --gd-workdir) + shift + GLUSTERD_WORKDIR=$1 + ;; + --volume-op) + shift + VOLUME_OP=$1 + ;; *) - shift - break - ;; - esac - shift + shift + break + ;; + esac + shift done ##---------------------------------------- -ENABLED_STATE="$GLUSTERD_WORKING_DIR/hooks/$VERSION/$VOLUME_OP/post/$ENABLED_NAME" +ENABLED_STATE="$GLUSTERD_WORKDIR/hooks/$VERSION/$VOLUME_OP/post/$ENABLED_NAME" FLAG=`gluster volume quota $VOL_NAME list / 2>&1 | grep \ diff --git a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh index 0801386549a..348f34ec3db 100755 --- a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh +++ b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh @@ -23,7 +23,7 @@ OPTSPEC="volname:,version:,gd-workdir:,volume-op:" PROGNAME="Quota-xattr-heal-add-brick-pre" VOL_NAME= -GLUSTERD_WORKING_DIR= +GLUSTERD_WORKDIR= VOLUME_OP= VERSION= ENABLED_NAME="S28Quota-root-xattr-heal.sh" @@ -42,35 +42,35 @@ eval set -- "$ARGS" while true; do - case $1 in + case $1 in --volname) - shift - VOL_NAME=$1 - ;; + shift + VOL_NAME=$1 + ;; --gd-workdir) - shift - GLUSTERD_WORKING_DIR=$1 - ;; + shift + GLUSTERD_WORKDIR=$1 + ;; --volume-op) - shift - VOLUME_OP=$1 - ;; + shift + VOLUME_OP=$1 + ;; --version) - shift - VERSION=$1 - ;; + shift + VERSION=$1 + ;; *) - shift - break - ;; - esac - shift + shift + break + ;; + esac + shift done ##---------------------------------------- -DISABLED_STATE="$GLUSTERD_WORKING_DIR/hooks/$VERSION/add-brick/post/$DISABLED_NAME" -ENABLED_STATE_START="$GLUSTERD_WORKING_DIR/hooks/$VERSION/start/post/$ENABLED_NAME" -ENABLED_STATE_ADD_BRICK="$GLUSTERD_WORKING_DIR/hooks/$VERSION/add-brick/post/$ENABLED_NAME"; +DISABLED_STATE="$GLUSTERD_WORKDIR/hooks/$VERSION/add-brick/post/$DISABLED_NAME" +ENABLED_STATE_START="$GLUSTERD_WORKDIR/hooks/$VERSION/start/post/$ENABLED_NAME" +ENABLED_STATE_ADD_BRICK="$GLUSTERD_WORKDIR/hooks/$VERSION/add-brick/post/$ENABLED_NAME"; ## Why to proceed if the required script itself is not present? ls $DISABLED_STATE; @@ -80,7 +80,7 @@ then fi ## Is quota enabled? -FLAG=`cat $GLUSTERD_WORKING_DIR/vols/$VOL_NAME/info | grep "^features.quota=" \ +FLAG=`cat $GLUSTERD_WORKDIR/vols/$VOL_NAME/info | grep "^features.quota=" \ | awk -F'=' '{print $NF}'`; if [ "$FLAG" != "on" ] then @@ -88,7 +88,7 @@ then fi ## Is volume started? -FLAG=`cat $GLUSTERD_WORKING_DIR/vols/$VOL_NAME/info | grep "^status=" \ +FLAG=`cat $GLUSTERD_WORKDIR/vols/$VOL_NAME/info | grep "^status=" \ | awk -F'=' '{print $NF}'`; if [ "$FLAG" != "1" ] then diff --git a/extras/hook-scripts/reset/post/S31ganesha-reset.sh b/extras/hook-scripts/reset/post/S31ganesha-reset.sh index a683af5c0c0..c0be3f3841d 100755 --- a/extras/hook-scripts/reset/post/S31ganesha-reset.sh +++ b/extras/hook-scripts/reset/post/S31ganesha-reset.sh @@ -1,27 +1,35 @@ #/bin/bash PROGNAME="Sganesha-reset" -OPTSPEC="volname:" +OPTSPEC="volname:,gd-workdir:" VOL= +GLUSTERD_WORKDIR= function parse_args () { ARGS=$(getopt -l $OPTSPEC -o "o" -name $PROGNAME $@) eval set -- "$ARGS" - case $1 in - --volname) - shift - VOL=$1 - ;; - esac + while true; do + case $1 in + --volname) + shift + VOL=$1 + ;; + --gd-workdir) + shift + GLUSTERD_WORKDIR=$1 + ;; + esac + shift + done } function is_volume_started () { volname=$1 - echo "$(grep status /var/lib/glusterd/vols/"$volname"/info |\ + echo "$(grep status $GLUSTERD_WORKDIR/vols/"$volname"/info |\ cut -d"=" -f2)" } parse_args $@ -if ps aux | grep -q "[g]anesha.nfsd" +if ps auxwww | grep -q "[g]anesha.nfsd" then kill -s TERM `cat /var/run/ganesha.pid` sleep 10 @@ -33,6 +41,3 @@ if ps aux | grep -q "[g]anesha.nfsd" gluster volume start $VOL force fi fi - - - diff --git a/extras/hook-scripts/set/post/S30samba-set.sh b/extras/hook-scripts/set/post/S30samba-set.sh index 3ff368207c4..9153dcd0bb2 100755 --- a/extras/hook-scripts/set/post/S30samba-set.sh +++ b/extras/hook-scripts/set/post/S30samba-set.sh @@ -18,11 +18,12 @@ PROGNAME="Ssamba-set" -OPTSPEC="volname:" +OPTSPEC="volname:,gd-workdir:" VOL= CONFIGFILE= LOGFILEBASE= PIDDIR= +GLUSTERD_WORKDIR= enable_smb="" @@ -32,29 +33,32 @@ function parse_args () { while true; do case $1 in - --volname) - shift - VOL=$1 - ;; - *) - shift - for pair in $@; do + --volname) + shift + VOL=$1 + ;; + --gd-workdir) + shift + GLUSTERD_WORKDIR=$1 + ;; + *) + shift + for pair in $@; do read key value < <(echo "$pair" | tr "=" " ") case "$key" in "user.cifs") - enable_smb=$value - ;; + enable_smb=$value + ;; "user.smb") - enable_smb=$value - ;; + enable_smb=$value + ;; *) - ;; + ;; esac - done - - shift - break - ;; + done + shift + break + ;; esac shift done @@ -102,7 +106,7 @@ function del_samba_share () { function is_volume_started () { volname=$1 - echo "$(grep status /var/lib/glusterd/vols/"$volname"/info |\ + echo "$(grep status $GLUSTERD_WORKDIR/vols/"$volname"/info |\ cut -d"=" -f2)" } diff --git a/extras/hook-scripts/set/post/S31ganesha-set.sh b/extras/hook-scripts/set/post/S31ganesha-set.sh index 972f82c5730..b09a3942a8e 100755 --- a/extras/hook-scripts/set/post/S31ganesha-set.sh +++ b/extras/hook-scripts/set/post/S31ganesha-set.sh @@ -1,6 +1,6 @@ #!/bin/bash PROGNAME="Sganesha-set" -OPTSPEC="volname:" +OPTSPEC="volname:,gd-workdir:" VOL= declare -i EXPORT_ID GANESHA_DIR="/var/lib/glusterfs-ganesha" @@ -11,7 +11,7 @@ gnfs="enabled" enable_ganesha="" host_name="none" LOC="" - +GLUSTERD_WORKDIR= function parse_args () @@ -21,29 +21,32 @@ function parse_args () while true; do case $1 in - --volname) - shift - VOL=$1 - ;; - *) - shift - for pair in $@; do + --volname) + shift + VOL=$1 + ;; + --gd-workdir) + shift + GLUSTERD_WORKDIR=$1 + ;; + *) + shift + for pair in $@; do read key value < <(echo "$pair" | tr "=" " ") case "$key" in - "nfs-ganesha.enable") - enable_ganesha=$value - ;; - "nfs-ganesha.host") - host_name=$value - ;; + "nfs-ganesha.enable") + enable_ganesha=$value + ;; + "nfs-ganesha.host") + host_name=$value + ;; *) - ;; + ;; esac - done - - shift - break - ;; + done + shift + break + ;; esac shift done @@ -52,7 +55,7 @@ function parse_args () function check_if_host_set() { - if ! cat /var/lib/glusterd/vols/$VOL/info | grep -q "nfs-ganesha.host" + if ! cat $GLUSTERD_WORKDIR/vols/$VOL/info | grep -q "nfs-ganesha.host" then exit 1 fi @@ -71,7 +74,7 @@ function check_nfsd_loc() function check_gluster_nfs() { - if cat /var/lib/glusterd/vols/$VOL/info | grep -q "nfs.disable=ON" + if cat $GLUSTERD_WORKDIR/vols/$VOL/info | grep -q "nfs.disable=ON" then gnfs="disabled" fi @@ -279,5 +282,3 @@ function stop_ganesha() fi fi - - diff --git a/extras/hook-scripts/start/post/S30samba-start.sh b/extras/hook-scripts/start/post/S30samba-start.sh index 34fde0ef8c0..43dc8e108da 100755 --- a/extras/hook-scripts/start/post/S30samba-start.sh +++ b/extras/hook-scripts/start/post/S30samba-start.sh @@ -21,28 +21,33 @@ #volume. PROGNAME="Ssamba-start" -OPTSPEC="volname:" +OPTSPEC="volname:,gd-workdir:" VOL= CONFIGFILE= LOGFILEBASE= PIDDIR= +GLUSTERD_WORKDIR= function parse_args () { ARGS=$(getopt -l $OPTSPEC -name $PROGNAME $@) eval set -- "$ARGS" while true; do - case $1 in - --volname) - shift - VOL=$1 - ;; - *) - shift - break - ;; - esac - shift + case $1 in + --volname) + shift + VOL=$1 + ;; + --gd-workdir) + shift + GLUSTERD_WORKDIR=$1 + ;; + *) + shift + break + ;; + esac + shift done } @@ -85,9 +90,9 @@ function get_smb () { volname=$1 uservalue= - usercifsvalue=$(grep user.cifs /var/lib/glusterd/vols/"$volname"/info |\ + usercifsvalue=$(grep user.cifs $GLUSTERD_WORKDIR/vols/"$volname"/info |\ cut -d"=" -f2) - usersmbvalue=$(grep user.smb /var/lib/glusterd/vols/"$volname"/info |\ + usersmbvalue=$(grep user.smb $GLUSTERD_WORKDIR/vols/"$volname"/info |\ cut -d"=" -f2) if [[ $usercifsvalue = "disable" || $usersmbvalue = "disable" ]]; then diff --git a/extras/init.d/glusterd-FreeBSD.in b/extras/init.d/glusterd-FreeBSD.in index 5eed6360a89..21c3da72624 100644 --- a/extras/init.d/glusterd-FreeBSD.in +++ b/extras/init.d/glusterd-FreeBSD.in @@ -16,7 +16,7 @@ start_precmd="glusterd_prestart" glusterd_prestart() { - mkdir -p /var/lib/glusterd /var/log/glusterfs + mkdir -p @GLUSTERD_WORKDIR@ /var/log/glusterfs return 0 } diff --git a/extras/systemd/glusterd.service.in b/extras/systemd/glusterd.service.in index fc8d8c9a235..a5d260d86e7 100644 --- a/extras/systemd/glusterd.service.in +++ b/extras/systemd/glusterd.service.in @@ -5,9 +5,9 @@ Before=network-online.target [Service] Type=forking -PIDFile=/run/glusterd.pid +PIDFile=@localstatedir@/run/glusterd.pid LimitNOFILE=65536 -ExecStart=@prefix@/sbin/glusterd -p /run/glusterd.pid +ExecStart=@prefix@/sbin/glusterd -p @localstatedir@/run/glusterd.pid KillMode=process [Install] diff --git a/geo-replication/src/Makefile.am b/geo-replication/src/Makefile.am index 20b5b6bde6b..68b18c66e88 100644 --- a/geo-replication/src/Makefile.am +++ b/geo-replication/src/Makefile.am @@ -1,4 +1,3 @@ - gsyncddir = $(libexecdir)/glusterfs gsyncd_SCRIPTS = gverify.sh peer_add_secret_pub peer_gsec_create set_geo_rep_pem_keys.sh @@ -11,8 +10,7 @@ gsyncd_PROGRAMS = gsyncd gsyncd_SOURCES = gsyncd.c procdiggy.c -gsyncd_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ - $(GF_GLUSTERFS_LIBS) +gsyncd_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la gsyncd_LDFLAGS = $(GF_LDFLAGS) diff --git a/geo-replication/src/peer_add_secret_pub.in b/geo-replication/src/peer_add_secret_pub.in index 122e577b446..97011f204d2 100644 --- a/geo-replication/src/peer_add_secret_pub.in +++ b/geo-replication/src/peer_add_secret_pub.in @@ -30,4 +30,4 @@ if [ ! -d $home_dir/.ssh/authorized_keys ]; then chown $user: $home_dir/.ssh/authorized_keys; fi -cat "$GLUSTERD_WORKING_DIR"/geo-replication/common_secret.pem.pub >> $home_dir/.ssh/authorized_keys; +cat "$GLUSTERD_WORKDIR"/geo-replication/common_secret.pem.pub >> $home_dir/.ssh/authorized_keys; diff --git a/geo-replication/src/peer_gsec_create.in b/geo-replication/src/peer_gsec_create.in index a39fdbfb5f7..9cadce56453 100755 --- a/geo-replication/src/peer_gsec_create.in +++ b/geo-replication/src/peer_gsec_create.in @@ -3,16 +3,16 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -if [ ! -f "$GLUSTERD_WORKING_DIR"/geo-replication/secret.pem.pub ]; then - \rm -rf "$GLUSTERD_WORKING_DIR"/geo-replication/secret.pem* - ssh-keygen -N '' -f "$GLUSTERD_WORKING_DIR"/geo-replication/secret.pem > /dev/null +if [ ! -f "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub ]; then + \rm -rf "$GLUSTERD_WORKDIR"/geo-replication/secret.pem* + ssh-keygen -N '' -f "$GLUSTERD_WORKDIR"/geo-replication/secret.pem > /dev/null fi -if [ ! -f "$GLUSTERD_WORKING_DIR"/geo-replication/tar_ssh.pem.pub ]; then - \rm -rf "$GLUSTERD_WORKING_DIR"/geo-replication/tar_ssh.pem* - ssh-keygen -N '' -f "$GLUSTERD_WORKING_DIR"/geo-replication/tar_ssh.pem > /dev/null +if [ ! -f "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub ]; then + \rm -rf "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem* + ssh-keygen -N '' -f "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem > /dev/null fi -output1=`echo command=\"${exec_prefix}/libexec/glusterfs/gsyncd\" " "``cat "$GLUSTERD_WORKING_DIR"/geo-replication/secret.pem.pub` -output2=`echo command=\"tar \$\{SSH_ORIGINAL_COMMAND#* \}\" " "``cat "$GLUSTERD_WORKING_DIR"/geo-replication/tar_ssh.pem.pub` +output1=`echo command=\"${exec_prefix}/libexec/glusterfs/gsyncd\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub` +output2=`echo command=\"tar \$\{SSH_ORIGINAL_COMMAND#* \}\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub` echo -e "$output1\n$output2" diff --git a/geo-replication/src/set_geo_rep_pem_keys.sh b/geo-replication/src/set_geo_rep_pem_keys.sh index 7a7bcad25c2..7b825693fad 100755 --- a/geo-replication/src/set_geo_rep_pem_keys.sh +++ b/geo-replication/src/set_geo_rep_pem_keys.sh @@ -1,7 +1,7 @@ #!/bin/bash # Script to copy the pem keys from the user's home directory -# to $GLUSTERD_WORKING_DIR/geo-replication/ and then copy +# to $GLUSTERD_WORKDIR/geo-replication and then copy # the keys to other nodes in the cluster and add them to the # respective authorized keys. The script takes as argument the # user name and assumes that the user will be present in all @@ -28,7 +28,7 @@ function main() fi if [ -f $home_dir/common_secret.pem.pub ]; then - cp $home_dir/common_secret.pem.pub /var/lib/glusterd/geo-replication/ + cp $home_dir/common_secret.pem.pub ${GLUSTERD_WORKDIR}/geo-replication/ gluster system:: copy file /geo-replication/common_secret.pem.pub gluster system:: execute add_secret_pub $user else diff --git a/geo-replication/syncdaemon/configinterface.py b/geo-replication/syncdaemon/configinterface.py.in index a94e07f0d4b..acb51486a10 100644 --- a/geo-replication/syncdaemon/configinterface.py +++ b/geo-replication/syncdaemon/configinterface.py.in @@ -36,7 +36,7 @@ CONFIGS = ( ("peersrx . .", "georep_session_working_dir", "", - "/var/lib/glusterd/geo-replication/${mastervol}_${remotehost}_" + "@GLUSTERD_WORKDIR@/geo-replication/${mastervol}_${remotehost}_" "${slavevol}/"), ("peersrx .", "gluster_params", @@ -46,7 +46,7 @@ CONFIGS = ( "ssh_command_tar", "", "ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no " - "-i /var/lib/glusterd/geo-replication/tar_ssh.pem"), + "-i @GLUSTERD_WORKDIR@/geo-replication/tar_ssh.pem"), ("peersrx . .", "changelog_log_file", "", @@ -54,11 +54,7 @@ CONFIGS = ( "/${eSlave}${local_id}-changes.log"), ("peersrx . .", "working_dir", - "/var/run/gluster/${mastervol}/${eSlave}", - "${iprefix}/lib/misc/glusterfsd/${mastervol}/${eSlave}"), - ("peersrx . .", - "working_dir", - "/usr/local/var/run/gluster/${mastervol}/${eSlave}", + "@localstatedir@/run/gluster/${mastervol}/${eSlave}", "${iprefix}/lib/misc/glusterfsd/${mastervol}/${eSlave}"), ) diff --git a/glusterfsd/src/Makefile.am b/glusterfsd/src/Makefile.am index e66d8ed3199..a2f05b64f65 100644 --- a/glusterfsd/src/Makefile.am +++ b/glusterfsd/src/Makefile.am @@ -3,8 +3,8 @@ sbin_PROGRAMS = glusterfsd glusterfsd_SOURCES = glusterfsd.c glusterfsd-mgmt.c glusterfsd_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ $(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \ - $(top_builddir)/rpc/xdr/src/libgfxdr.la \ - $(GF_LDADD) $(GF_GLUSTERFS_LIBS) + $(top_builddir)/rpc/xdr/src/libgfxdr.la ${GF_LDADD} + glusterfsd_LDFLAGS = $(GF_LDFLAGS) noinst_HEADERS = glusterfsd.h glusterfsd-mem-types.h glusterfsd-messages.h diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h index 0f6c108ee64..eba1413a1e6 100644 --- a/libglusterfs/src/call-stub.h +++ b/libglusterfs/src/call-stub.h @@ -170,10 +170,10 @@ typedef struct { struct statvfs statvfs; dict_t *xattr; struct gf_flock lock; - gf_dirent_t entries; uint32_t weak_checksum; uint8_t *strong_checksum; dict_t *xdata; + gf_dirent_t entries; } args_cbk; } call_stub_t; diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index eb3d8963cab..d9de5b1505c 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -158,6 +158,11 @@ #define DEFAULT_VAR_RUN_DIRECTORY DATADIR "/run/gluster" #define DEFAULT_GLUSTERFSD_MISC_DIRETORY DATADIR "/lib/misc/glusterfsd" +#ifdef GF_LINUX_HOST_OS +#define GLUSTERD_DEFAULT_WORKDIR DATADIR "/lib/glusterd" +#else +#define GLUSTERD_DEFAULT_WORKDIR DATADIR "/db/glusterd" +#endif #define GF_REPLICATE_TRASH_DIR ".landfill" /* GlusterFS's maximum supported Auxiliary GIDs */ @@ -577,9 +582,8 @@ struct gf_flock { * reduce functionality, both for users and for testing (which can now be * done using secure connections for all tests without change elsewhere). * - * Nonetheless, TBD: define in terms of build-time PREFIX */ -#define SECURE_ACCESS_FILE "/var/lib/glusterd/secure-access" +#define SECURE_ACCESS_FILE GLUSTERD_DEFAULT_WORKDIR "/secure-access" int glusterfs_graph_prepare (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx); int glusterfs_graph_destroy (glusterfs_graph_t *graph); diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 1a52af7833a..e3a07649340 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -134,7 +134,6 @@ struct syncargs { struct iatt iatt1; struct iatt iatt2; dict_t *xattr; - gf_dirent_t entries; struct statvfs statvfs_buf; struct iovec *vector; int count; @@ -156,6 +155,7 @@ struct syncargs { pthread_mutex_t mutex; pthread_cond_t cond; int done; + gf_dirent_t entries; }; struct syncopctx { diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index a10f182647f..1238a6a1c1e 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -107,7 +107,7 @@ out: rpcsvc_vector_sizer rpcsvc_get_program_vector_sizer (rpcsvc_t *svc, uint32_t prognum, - uint32_t progver, uint32_t procnum) + uint32_t progver, int procnum) { rpcsvc_program_t *program = NULL; char found = 0; diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h index 5a991d4993f..911fc958cc0 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -604,5 +604,5 @@ int rpcsvc_auth_array (rpcsvc_t *svc, char *volname, int *autharr, int arrlen); rpcsvc_vector_sizer rpcsvc_get_program_vector_sizer (rpcsvc_t *svc, uint32_t prognum, - uint32_t progver, uint32_t procnum); + uint32_t progver, int procnum); #endif diff --git a/rpc/xdr/src/xdr-nfs3.c b/rpc/xdr/src/xdr-nfs3.c index 2be83924ac6..0e145fc9954 100644 --- a/rpc/xdr/src/xdr-nfs3.c +++ b/rpc/xdr/src/xdr-nfs3.c @@ -8,6 +8,20 @@ cases as published by the Free Software Foundation. */ +#if defined(__GNUC__) +#if __GNUC__ >= 4 +#if !defined(__clang__) +#if !defined(__NetBSD__) +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif +#else +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-value" +#endif +#endif +#endif + #include "xdr-nfs3.h" #include "mem-pool.h" #include "xdr-common.h" diff --git a/run-tests.sh b/run-tests.sh index 9b71aea9516..12d902fbc88 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -165,7 +165,7 @@ function run_tests() echo "Running tests in file $t" prove -f --timer $t fi - TMP_RES=$? + TMP_RES=$? if [ ${TMP_RES} -ne 0 ] ; then RES=${TMP_RES} FAILED="$FAILED $t" diff --git a/tests/README.md b/tests/README.md index 84138fffb45..50e1a9d5005 100644 --- a/tests/README.md +++ b/tests/README.md @@ -34,4 +34,4 @@ Regression tests framework for GlusterFS `gluster-devel@gluster.org`. ## Reminder -- BE WARNED THAT THE TEST CASES DELETE /var/lib/glusterd/* !!! +- BE WARNED THAT THE TEST CASES DELETE ``GLUSTERD_WORKDIR`` * !!! diff --git a/tests/basic/mount-options.disabled b/tests/basic/mount-options.disabled index 67f893ca488..2373e4461ce 100644 --- a/tests/basic/mount-options.disabled +++ b/tests/basic/mount-options.disabled @@ -24,7 +24,7 @@ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --entry-timeout=0 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 -TEST glusterfs --volfile=/var/lib/glusterd/vols/$V0/${V0}-fuse.vol $M0 +TEST glusterfs --volfile=$GLUSTERD_WORKDIR/vols/$V0/${V0}-fuse.vol $M0 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 --log-file=/tmp/a.txt --log-level=DEBUG $M0 diff --git a/tests/bugs/bug-1119582.t b/tests/bugs/bug-1119582.t index 9251927e314..cc388bde605 100644 --- a/tests/bugs/bug-1119582.t +++ b/tests/bugs/bug-1119582.t @@ -17,7 +17,7 @@ TEST $CLI volume set $V0 features.uss disable; TEST killall glusterd; -rm -f /var/lib/glusterd/vols/$V0/snapd.info +rm -f $GLUSTERD_WORKDIR/vols/$V0/snapd.info TEST glusterd diff --git a/tests/bugs/bug-765380.t b/tests/bugs/bug-765380.t index a9784b93d0c..65bc6597eea 100644 --- a/tests/bugs/bug-765380.t +++ b/tests/bugs/bug-765380.t @@ -31,7 +31,7 @@ TEST $CLI volume set $V0 node-uuid-pathinfo on # do not expext hostname as part of the pathinfo string EXPECT 0 count_hostname_or_uuid_from_pathinfo $H0 -uuid=`grep UUID /var/lib/glusterd/glusterd.info | cut -f2 -d=` +uuid=`grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f2 -d=` # ... but expect the uuid $REPLICA times EXPECT $REPLICA count_hostname_or_uuid_from_pathinfo $uuid diff --git a/tests/bugs/bug-797171.t b/tests/bugs/bug-797171.t index f160e418c2b..d29c4bd7a2a 100755 --- a/tests/bugs/bug-797171.t +++ b/tests/bugs/bug-797171.t @@ -21,8 +21,8 @@ $M0; touch $M0/{1..22}; rm -f $M0/*; -pid_file=$(ls /var/lib/glusterd/vols/$V0/run); -brick_pid=$(cat /var/lib/glusterd/vols/$V0/run/$pid_file); +pid_file=$(ls $GLUSTERD_WORKDIR/vols/$V0/run); +brick_pid=$(cat $GLUSTERD_WORKDIR/vols/$V0/run/$pid_file); mkdir $statedumpdir/statedump_tmp/; echo "path=$statedumpdir/statedump_tmp" > $statedumpdir/glusterdump.options; diff --git a/tests/bugs/bug-811493.t b/tests/bugs/bug-811493.t index 13e99af5798..966995945cb 100755 --- a/tests/bugs/bug-811493.t +++ b/tests/bugs/bug-811493.t @@ -8,10 +8,10 @@ TEST glusterd TEST pidof glusterd TEST $CLI system uuid reset; -uuid1=$(grep UUID /var/lib/glusterd/glusterd.info | cut -f 2 -d "="); +uuid1=$(grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f 2 -d "="); TEST $CLI system uuid reset; -uuid2=$(grep UUID /var/lib/glusterd/glusterd.info | cut -f 2 -d "="); +uuid2=$(grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f 2 -d "="); TEST [ $uuid1 != $uuid2 ] diff --git a/tests/bugs/bug-856455.t b/tests/bugs/bug-856455.t index becb202225f..3e314aa5bb3 100644 --- a/tests/bugs/bug-856455.t +++ b/tests/bugs/bug-856455.t @@ -35,7 +35,7 @@ EXPECT $BRICK_COUNT query_pathinfo $M0/f00d; # Kill a brick process and then query for pathinfo # for directories pathinfo should list backend patch from available (up) subvolumes -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; EXPECT `expr $BRICK_COUNT - 1` query_pathinfo $M0/f00d; diff --git a/tests/bugs/bug-858215.t b/tests/bugs/bug-858215.t index eafb4a9621d..8f11b7f3921 100755 --- a/tests/bugs/bug-858215.t +++ b/tests/bugs/bug-858215.t @@ -39,8 +39,8 @@ TEST touch $M0/newfile; TEST stat $M0/newfile; TEST rm $M0/newfile; -nfs_pid=$(cat /var/lib/glusterd/nfs/run/nfs.pid); -glustershd_pid=$(cat /var/lib/glusterd/glustershd/run/glustershd.pid); +nfs_pid=$(cat $GLUSTERD_WORKDIR/nfs/run/nfs.pid); +glustershd_pid=$(cat $GLUSTERD_WORKDIR/glustershd/run/glustershd.pid); pids=$(pidof glusterfs); for i in $pids diff --git a/tests/bugs/bug-860663.t b/tests/bugs/bug-860663.t index dd3fcc6793b..a4b3d71fb78 100644 --- a/tests/bugs/bug-860663.t +++ b/tests/bugs/bug-860663.t @@ -31,7 +31,7 @@ TEST touch $M0/files{1..10000}; ORIG_FILE_COUNT=`ls -l $M0 | wc -l`; # Kill a brick process -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; TEST $CLI volume rebalance $V0 fix-layout start diff --git a/tests/bugs/bug-861542.t b/tests/bugs/bug-861542.t index 5fd08f12d02..f4fd4e52a58 100755 --- a/tests/bugs/bug-861542.t +++ b/tests/bugs/bug-861542.t @@ -40,7 +40,7 @@ TEST $CLI --xml volume status $V0; TEST $CLI --xml volume status $V0 detail; # Kill the brick process. After this, port number for the killed (in this case brick) process must be "N/A". -kill `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-brick0.pid` +kill `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-brick0.pid` EXPECT "N/A" port_field $V0 '0'; # volume status EXPECT "N/A" port_field $V0 '1'; # volume status detail diff --git a/tests/bugs/bug-862967.t b/tests/bugs/bug-862967.t index 00fa884408a..bd500b1da9d 100644 --- a/tests/bugs/bug-862967.t +++ b/tests/bugs/bug-862967.t @@ -36,7 +36,7 @@ chown 1:1 $M0/dir; # Kill a brick process -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; # change dir ownership NEW_UID=36; NEW_GID=36; diff --git a/tests/bugs/bug-867253.t b/tests/bugs/bug-867253.t index 560ff11a28e..6b0332959e9 100644 --- a/tests/bugs/bug-867253.t +++ b/tests/bugs/bug-867253.t @@ -35,7 +35,7 @@ TEST mount -o vers=3,nolock,noac -t nfs $H0:/$V0 $M0; touch $M0/files{1..1000}; # Kill a brick process -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}0.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}0.pid`; echo 3 >/proc/sys/vm/drop_caches; @@ -46,7 +46,7 @@ NEW_FILE_COUNT=`echo $?`; TEST $CLI volume start $V0 force # Kill a brick process -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}1.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`; echo 3 >/proc/sys/vm/drop_caches; diff --git a/tests/bugs/bug-874498.t b/tests/bugs/bug-874498.t index 9337e6dc680..843698d2a61 100644 --- a/tests/bugs/bug-874498.t +++ b/tests/bugs/bug-874498.t @@ -14,7 +14,7 @@ TEST $CLI volume start $V0; TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; B0_hiphenated=`echo $B0 | tr '/' '-'` -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0$B0_hiphenated-brick1.pid` ; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0$B0_hiphenated-brick1.pid` ; echo "GLUSTER FILE SYSTEM" > $M0/FILE1 echo "GLUSTER FILE SYSTEM" > $M0/FILE2 diff --git a/tests/bugs/bug-877992.t b/tests/bugs/bug-877992.t index 932ecc77b86..979cbfd3fdc 100755 --- a/tests/bugs/bug-877992.t +++ b/tests/bugs/bug-877992.t @@ -23,21 +23,21 @@ function hooks_prep () { local event=$1 touch /tmp/pre.out /tmp/post.out - touch /var/lib/glusterd/hooks/1/"$event"/pre/Spre.sh - touch /var/lib/glusterd/hooks/1/"$event"/post/Spost.sh + touch $GLUSTERD_WORKDIR/hooks/1/"$event"/pre/Spre.sh + touch $GLUSTERD_WORKDIR/hooks/1/"$event"/post/Spost.sh - printf "#! /bin/bash\necho "$event"Pre > /tmp/pre.out\n" > /var/lib/glusterd/hooks/1/"$event"/pre/Spre.sh - printf "#! /bin/bash\necho "$event"Post > /tmp/post.out\n" > /var/lib/glusterd/hooks/1/"$event"/post/Spost.sh - chmod a+x /var/lib/glusterd/hooks/1/"$event"/pre/Spre.sh - chmod a+x /var/lib/glusterd/hooks/1/"$event"/post/Spost.sh + printf "#! /bin/bash\necho "$event"Pre > /tmp/pre.out\n" > $GLUSTERD_WORKDIR/hooks/1/"$event"/pre/Spre.sh + printf "#! /bin/bash\necho "$event"Post > /tmp/post.out\n" > $GLUSTERD_WORKDIR/hooks/1/"$event"/post/Spost.sh + chmod a+x $GLUSTERD_WORKDIR/hooks/1/"$event"/pre/Spre.sh + chmod a+x $GLUSTERD_WORKDIR/hooks/1/"$event"/post/Spost.sh } function hooks_cleanup () { local event=$1 rm /tmp/pre.out /tmp/post.out - rm /var/lib/glusterd/hooks/1/"$event"/pre/Spre.sh - rm /var/lib/glusterd/hooks/1/"$event"/post/Spost.sh + rm $GLUSTERD_WORKDIR/hooks/1/"$event"/pre/Spre.sh + rm $GLUSTERD_WORKDIR/hooks/1/"$event"/post/Spost.sh } ## Verify volume is created and its hooks script ran diff --git a/tests/bugs/bug-880898.t b/tests/bugs/bug-880898.t index a069d4a8ac1..8ba35ec1a59 100644 --- a/tests/bugs/bug-880898.t +++ b/tests/bugs/bug-880898.t @@ -9,7 +9,7 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/brick1 $H0:$B0/brick2 TEST $CLI volume start $V0 pkill glusterfs uuid="" -for line in $(cat /var/lib/glusterd/glusterd.info) +for line in $(cat $GLUSTERD_WORKDIR/glusterd.info) do if [[ $line == UUID* ]] then diff --git a/tests/bugs/bug-893378.t b/tests/bugs/bug-893378.t index fd8b9a7ceba..46aec53cfd3 100755 --- a/tests/bugs/bug-893378.t +++ b/tests/bugs/bug-893378.t @@ -59,7 +59,7 @@ then get_cached_brick CACHED=$? # Kill a brick process - kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}$CACHED.pid`; + kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}$CACHED.pid`; fi ## trigger a lookup diff --git a/tests/bugs/bug-902610.t b/tests/bugs/bug-902610.t index 3f26fdde970..9b824b1b558 100755 --- a/tests/bugs/bug-902610.t +++ b/tests/bugs/bug-902610.t @@ -54,8 +54,8 @@ TEST glusterfs -s $H0 --volfile-id $V0 $M0 --entry-timeout=0 --attribute-timeout TEST ls -l $M0 ## kill 2 bricks to bring down available subvol < spread count -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}2.pid`; -kill -9 `cat /var/lib/glusterd/vols/$V0/run/$H0-d-backends-${V0}3.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}2.pid`; +kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}3.pid`; mkdir $M0/dir1 2>/dev/null diff --git a/tests/bugs/bug-904065.t b/tests/bugs/bug-904065.t index 01880246ef2..0b39adb5c68 100755 --- a/tests/bugs/bug-904065.t +++ b/tests/bugs/bug-904065.t @@ -38,7 +38,7 @@ EXPECT 'Started' volinfo_field $V0 'Status' EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available # before mounting the rmtab should be empty -EXPECT '0' count_lines /var/lib/glusterd/nfs/rmtab +EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab TEST mount_nfs $H0:/$V0 $N0 nolock # the output would looks similar to: @@ -46,19 +46,19 @@ TEST mount_nfs $H0:/$V0 $N0 nolock # hostname-0=172.31.122.104 # mountpoint-0=/ufo # -EXPECT '2' count_lines /var/lib/glusterd/nfs/rmtab +EXPECT '2' count_lines $GLUSTERD_WORKDIR/nfs/rmtab # duplicate mounts should not be recorded (client could have crashed) TEST mount_nfs $H0:/$V0 $N1 nolock -EXPECT '2' count_lines /var/lib/glusterd/nfs/rmtab +EXPECT '2' count_lines $GLUSTERD_WORKDIR/nfs/rmtab # removing a mount should (even if there are two) should remove the entry EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N1 -EXPECT '0' count_lines /var/lib/glusterd/nfs/rmtab +EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab # unmounting the other mount should work flawlessly EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 -EXPECT '0' count_lines /var/lib/glusterd/nfs/rmtab +EXPECT '0' count_lines $GLUSTERD_WORKDIR/nfs/rmtab TEST glusterfs --entry-timeout=0 --attribute-timeout=0 --volfile-server=$H0 --volfile-id=$V0 $M0 diff --git a/tests/bugs/bug-916549.t b/tests/bugs/bug-916549.t index d6a45b8270f..344c6abaaf1 100755 --- a/tests/bugs/bug-916549.t +++ b/tests/bugs/bug-916549.t @@ -8,8 +8,8 @@ TEST glusterd; TEST $CLI volume create $V0 $H0:$B0/${V0}1; TEST $CLI volume start $V0; -pid_file=$(ls /var/lib/glusterd/vols/$V0/run); -brick_pid=$(cat /var/lib/glusterd/vols/$V0/run/$pid_file); +pid_file=$(ls $GLUSTERD_WORKDIR/vols/$V0/run); +brick_pid=$(cat $GLUSTERD_WORKDIR/vols/$V0/run/$pid_file); kill -SIGKILL $brick_pid; diff --git a/tests/bugs/bug-955588.t b/tests/bugs/bug-955588.t index 3f03611673d..182035c6132 100755 --- a/tests/bugs/bug-955588.t +++ b/tests/bugs/bug-955588.t @@ -18,7 +18,7 @@ function get_brick_host_uuid() TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} -uuid=`grep UUID /var/lib/glusterd/glusterd.info | cut -f2 -d=` +uuid=`grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f2 -d=` EXPECT $uuid get_brick_host_uuid $V0 TEST $CLI volume delete $V0; diff --git a/tests/bugs/bug-958790.t b/tests/bugs/bug-958790.t index 6cc799c25ed..fc5f63a0c28 100644 --- a/tests/bugs/bug-958790.t +++ b/tests/bugs/bug-958790.t @@ -9,9 +9,9 @@ TEST glusterd; TEST pidof glusterd; TEST $CLI volume info; -touch /var/lib/glusterd/groups/test -echo "read-ahead=off" > /var/lib/glusterd/groups/test -echo "open-behind=off" >> /var/lib/glusterd/groups/test +touch $GLUSTERD_WORKDIR/groups/test +echo "read-ahead=off" > $GLUSTERD_WORKDIR/groups/test +echo "open-behind=off" >> $GLUSTERD_WORKDIR/groups/test TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; TEST $CLI volume set $V0 group test diff --git a/tests/env.rc.in b/tests/env.rc.in new file mode 100644 index 00000000000..000a80f18fb --- /dev/null +++ b/tests/env.rc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ + +PATH=@sbindir@:$PATH +export PATH + +LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH + +GLUSTERD_WORKDIR=@GLUSTERD_WORKDIR@ +export GLUSTERD_WORKDIR
\ No newline at end of file diff --git a/tests/include.rc b/tests/include.rc index 8919d0a663c..72c00588200 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -7,7 +7,20 @@ V0=${V0:=patchy}; # volume name to use in tests V1=${V1:=patchy1}; # volume name to use in tests B0=${B0:=/d/backends}; # top level of brick directories CC=cc -case `uname -s` in +OSTYPE=$(uname -s) + +if [ ! -f ${PWD}/tests/env.rc ]; then + echo "Aborting." + echo + echo "env.rc not found" + echo + echo "Please correct the problem and try again." + echo + exit 1 +fi +. ${PWD}/tests/env.rc + +case $OSTYPE in Linux) H0=${H0:=`hostname --fqdn`}; # hostname ;; @@ -15,6 +28,7 @@ Linux) H0=${H0:=`hostname`}; # hostname ;; esac + DEBUG=${DEBUG:=0} # turn on debugging? PROCESS_UP_TIMEOUT=20 @@ -293,8 +307,9 @@ function cleanup() ;; esac - - rm -rf /var/lib/glusterd/* $B0/* /etc/glusterd/*; + if [ -n "${GLUSTERD_WORKDIR}" ] ; then + rm -rf $GLUSTERD_WORKDIR/* $B0/* /etc/glusterd/*; + fi umount -l $M0 2>/dev/null || true; umount -l $M1 2>/dev/null || true; @@ -454,10 +469,9 @@ alias EXPECT_KEYWORD='_EXPECT_KEYWORD $LINENO' alias TEST_IN_LOOP='_TEST_IN_LOOP $LINENO' shopt -s expand_aliases -ostype=$(uname -s) -if [ x"$ostype" = x"Linux" ]; then +if [ x"$OSTYPE" = x"Linux" ]; then alias dd="dd status=none" -elif [ x"$ostype" = x"NetBSD" ]; then +elif [ x"$OSTYPE" = x"NetBSD" ]; then alias dd="dd msgfmt=quiet" fi # MacOS doesn't seem to support either option. Doing nothing at all is diff --git a/tests/volume.rc b/tests/volume.rc index 4e798dfc026..0f47f7e6741 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -53,7 +53,7 @@ function get_nfs_pid () function read_nfs_pidfile () { - echo `cat /var/lib/glusterd/nfs/run/nfs.pid` + echo `cat $GLUSTERD_WORKDIR/nfs/run/nfs.pid` } function cleanup_statedump { @@ -163,7 +163,7 @@ function get_brick_pid { local host=$2 local brick=$3 local brick_hiphenated=$(echo $brick | tr '/' '-') - echo `cat /var/lib/glusterd/vols/$vol/run/${host}${brick_hiphenated}.pid` + echo `cat $GLUSTERD_WORKDIR/vols/$vol/run/${host}${brick_hiphenated}.pid` } function kill_brick { diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 8cc4bf13bf1..988182acb63 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -724,13 +724,13 @@ io_stats_dump_global_to_logfp (xlator_t *this, struct ios_global_stats *stats, ios_log (this, logfp, "\nTIMESTAMP \t\t\t THROUGHPUT(KBPS)" "\tFILE NAME"); list_head = &conf->thru_list[IOS_STATS_THRU_READ]; - ios_dump_throughput_stats(list_head, this, logfp, IOS_STATS_THRU_READ); + ios_dump_throughput_stats(list_head, this, logfp, IOS_STATS_TYPE_READ); ios_log (this, logfp, "\n======Write Throughput File Stats======"); ios_log (this, logfp, "\nTIMESTAMP \t\t\t THROUGHPUT(KBPS)" "\tFILE NAME"); list_head = &conf->thru_list[IOS_STATS_THRU_WRITE]; - ios_dump_throughput_stats (list_head, this, logfp, IOS_STATS_THRU_WRITE); + ios_dump_throughput_stats (list_head, this, logfp, IOS_STATS_TYPE_WRITE); } return 0; } diff --git a/xlators/encryption/crypt/src/crypt.h b/xlators/encryption/crypt/src/crypt.h index b7aefc3d2c5..4a87f016089 100644 --- a/xlators/encryption/crypt/src/crypt.h +++ b/xlators/encryption/crypt/src/crypt.h @@ -39,14 +39,10 @@ #define MASTER_VOL_KEY_SIZE (32) #define NMTD_VOL_KEY_SIZE (16) -#if defined(GF_BSD_HOST_OS) +#if !defined(GF_LINUX_HOST_OS) typedef off_t loff_t; #endif -#if defined(GF_DARWIN_HOST_OS) -typedef uint64_t loff_t; -#endif - struct crypt_key { uint32_t len; const char *label; diff --git a/xlators/features/changelog/lib/src/Makefile.am b/xlators/features/changelog/lib/src/Makefile.am index 28d5a70aab2..1ae919bfb38 100644 --- a/xlators/features/changelog/lib/src/Makefile.am +++ b/xlators/features/changelog/lib/src/Makefile.am @@ -6,8 +6,7 @@ libgfchangelog_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 -fpic \ -I$(top_srcdir)/xlators/features/changelog/src \ -DDATADIR=\"$(localstatedir)\" -libgfchangelog_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ - $(GF_GLUSTERFS_LIBS) +libgfchangelog_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la libgfchangelog_la_LDFLAGS = $(GF_LDFLAGS) -version-info $(LIBGFCHANGELOG_LT_VERSION) diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c index ba3367b339a..07c6096dce5 100644 --- a/xlators/features/changelog/src/changelog-helpers.c +++ b/xlators/features/changelog/src/changelog-helpers.c @@ -25,7 +25,7 @@ #include "changelog-encoders.h" #include <pthread.h> -inline void +static inline void __mask_cancellation (xlator_t *this) { int ret = 0; @@ -36,7 +36,7 @@ __mask_cancellation (xlator_t *this) "failed to disable thread cancellation"); } -inline void +static inline void __unmask_cancellation (xlator_t *this) { int ret = 0; diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am index d8a1e257c4e..913a2a70729 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 c5fa245dbd8..b59353566a7 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1199,7 +1199,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 f7b4f012e03..f1139ad027d 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -464,7 +464,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" diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 55d0c51de18..cace3c247eb 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -338,9 +338,9 @@ check_recursive_mount () fi # check if the mount point is a brick's parent directory - GLUSTERD_WORKDIR="/var/lib/glusterd"; + GLUSTERD_WORKDIR="@GLUSTERD_WORKDIR@"; - ls -L "$GLUSTERD_WORKDIR"/vols/*/bricks/* > /dev/null 2>&1; + ls -L "${GLUSTERD_WORKDIR}"/vols/*/bricks/* > /dev/null 2>&1; if [ $? -ne 0 ]; then return; fi diff --git a/xlators/nfs/server/src/Makefile.am b/xlators/nfs/server/src/Makefile.am index 62fbf6535ca..32d93812b50 100644 --- a/xlators/nfs/server/src/Makefile.am +++ b/xlators/nfs/server/src/Makefile.am @@ -15,7 +15,7 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) \ -DLIBDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/auth\" \ -I$(top_srcdir)/libglusterfs/src \ -I$(nfsrpclibdir) -I$(CONTRIBDIR)/rbtree \ - -I$(top_srcdir)/rpc/xdr/src/ + -I$(top_srcdir)/rpc/xdr/src/ -DDATADIR=\"$(localstatedir)\" AM_CFLAGS = -Wall $(GF_CFLAGS) diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 422b7fa6c12..794b7171efc 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -43,9 +43,7 @@ #define OPT_SERVER_RPC_STATD_PIDFILE "nfs.rpc-statd-pidfile" #define OPT_SERVER_RPC_STATD_NOTIFY_PIDFILE "nfs.rpc-statd-notify-pidfile" -/* TODO: DATADIR should be based on configure's $(localstatedir) */ -#define DATADIR "/var/lib/glusterd" -#define NFS_DATADIR DATADIR "/nfs" +#define NFS_DATADIR GLUSTERD_DEFAULT_WORKDIR "/nfs" /* Forward declaration */ int nfs_add_initer (struct list_head *list, nfs_version_initer_t init); @@ -1853,7 +1851,7 @@ struct volume_options options[] = { }, { .key = {"nfs.mount-rmtab"}, .type = GF_OPTION_TYPE_PATH, - .default_value = DATADIR "/rmtab", + .default_value = NFS_DATADIR "/rmtab", .description = "Set the location of the cache file that is used to " "list all the NFS-clients that have connected " "through the MOUNT protocol. If this is on shared " |