summaryrefslogtreecommitdiff
path: root/filesystems/glusterfs
diff options
context:
space:
mode:
authormanu <manu>2011-06-06 15:53:13 +0000
committermanu <manu>2011-06-06 15:53:13 +0000
commit831f7cc218086d24b25ef4e61a96dd1fda6b31c8 (patch)
tree6e0aea38a28eb1feaa3d903dbbe3306218d2319c /filesystems/glusterfs
parent15f42d04be902ea774cec11fa22f98a907682102 (diff)
downloadpkgsrc-831f7cc218086d24b25ef4e61a96dd1fda6b31c8.tar.gz
Support the glusterd daemon (volume management tool).
Diffstat (limited to 'filesystems/glusterfs')
-rw-r--r--filesystems/glusterfs/Makefile13
-rw-r--r--filesystems/glusterfs/PLIST4
-rw-r--r--filesystems/glusterfs/distinfo4
-rwxr-xr-xfilesystems/glusterfs/files/glusterd.sh3
-rwxr-xr-xfilesystems/glusterfs/files/xattr-init.sh2
-rw-r--r--filesystems/glusterfs/patches/patch-bp19
-rw-r--r--filesystems/glusterfs/patches/patch-bq101
7 files changed, 139 insertions, 7 deletions
diff --git a/filesystems/glusterfs/Makefile b/filesystems/glusterfs/Makefile
index a915679be3e..7e1f70ce6c9 100644
--- a/filesystems/glusterfs/Makefile
+++ b/filesystems/glusterfs/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2011/05/19 14:54:22 manu Exp $
+# $NetBSD: Makefile,v 1.10 2011/06/06 15:53:13 manu Exp $
#
DISTNAME= glusterfs-3.2.0
+PKGREVISION= 2
CATEGORIES= filesystems
MASTER_SITES= http://download.gluster.com/pub/gluster/glusterfs/3.2/LATEST/
@@ -55,17 +56,25 @@ SUBST_FILES.etc+= doc/glusterfsd.8
SUBST_FILES.etc+= doc/glusterfsd.vol.sample
SUBST_SED.etc= -e "s,/etc/gluster,${PREFIX}/etc/gluster,g"
+SUBST_CLASSES+= vol
+SUBST_STAGE.vol= post-build
+SUBST_FILES.vol= doc/Makefile
+SUBST_SED.vol= -e "s/glusterd.vol/glusterd.vol.sample/g"
+
REPLACE_PYTHON+= ${WRKSRC}/extras/volgen/glusterfs-volgen
EGDIR= ${PREFIX}/etc/glusterfs
CONF_FILES+= ${EGDIR}/glusterfs.vol.sample ${EGDIR}/glusterfs.vol
CONF_FILES+= ${EGDIR}/glusterfsd.vol.sample ${EGDIR}/glusterfsd.vol
-CONF_FILES+= ${EGDIR}/glusterd.vol ${EGDIR}/glusterd.vol
+CONF_FILES+= ${EGDIR}/glusterd.vol.sample ${EGDIR}/glusterd.vol
OWN_DIRS+= ${VARBASE}/log/glusterfs
BUILD_DEFS+= VARBASE
RCD_SCRIPTS= glusterfsd glusterd
+post-build:
+ cp ${WRKSRC}/doc/glusterd.vol ${WRKSRC}/doc/glusterd.vol.sample
+
post-install:
${INSTALL_SCRIPT} ${DESTDIR}/sbin/mount.glusterfs \
${DESTDIR}/${PREFIX}/sbin/
diff --git a/filesystems/glusterfs/PLIST b/filesystems/glusterfs/PLIST
index 37197be84e3..2f5a78cf8fe 100644
--- a/filesystems/glusterfs/PLIST
+++ b/filesystems/glusterfs/PLIST
@@ -1,8 +1,8 @@
-@comment $NetBSD: PLIST,v 1.3 2011/05/19 14:54:22 manu Exp $
+@comment $NetBSD: PLIST,v 1.4 2011/06/06 15:53:13 manu Exp $
etc/glusterfs/xattr-init.sh
etc/glusterfs/glusterfs.vol.sample
etc/glusterfs/glusterfsd.vol.sample
-etc/glusterfs/glusterd.vol
+etc/glusterfs/glusterd.vol.sample
etc/glusterfs/xattr-init.sh
lib/libglusterfs.so.0.0.0
lib/libglusterfs.la
diff --git a/filesystems/glusterfs/distinfo b/filesystems/glusterfs/distinfo
index 1b3f36110a8..ddb93b8ed80 100644
--- a/filesystems/glusterfs/distinfo
+++ b/filesystems/glusterfs/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2011/05/19 14:54:22 manu Exp $
+$NetBSD: distinfo,v 1.4 2011/06/06 15:53:13 manu Exp $
SHA1 (glusterfs-3.2.0.tar.gz) = a8095e04feedce81aa21634639f278b3810398b8
RMD160 (glusterfs-3.2.0.tar.gz) = a69f47efd396a413ffb350e1711345ff49557325
@@ -24,3 +24,5 @@ SHA1 (patch-bl) = 11565e61240985be475ae54baeb8e58cd736132c
SHA1 (patch-bm) = 71156d3bd9dcc02b09db022ee20852f4b52e7306
SHA1 (patch-bn) = d806dc6319568279d79fcc7b14fddd76771aa210
SHA1 (patch-bo) = 3c564fc3854847d26e512ded60082715745a0b1c
+SHA1 (patch-bp) = 28363fc5468ef0bc930fe2551a78bed818ec2585
+SHA1 (patch-bq) = 52723f6fbb5c5e262a31ed8f9340f988dec4fbd9
diff --git a/filesystems/glusterfs/files/glusterd.sh b/filesystems/glusterfs/files/glusterd.sh
index 17998ada1ef..e0fe227c4ad 100755
--- a/filesystems/glusterfs/files/glusterd.sh
+++ b/filesystems/glusterfs/files/glusterd.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: glusterd.sh,v 1.2 2011/05/19 14:54:22 manu Exp $
+# $NetBSD: glusterd.sh,v 1.3 2011/06/06 15:53:14 manu Exp $
#
# PROVIDE: glusterd
@@ -13,6 +13,7 @@ name="glusterd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
pidfile="/var/run/${name}.pid"
+command_args="-p ${pidfile}"
required_files="@PREFIX@/etc/glusterfs/${name}.vol"
load_rc_config $name
diff --git a/filesystems/glusterfs/files/xattr-init.sh b/filesystems/glusterfs/files/xattr-init.sh
index d6cca39c16a..38b6b3baa92 100755
--- a/filesystems/glusterfs/files/xattr-init.sh
+++ b/filesystems/glusterfs/files/xattr-init.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# $NetBSD: xattr-init.sh,v 1.3 2011/05/19 14:54:22 manu Exp $
+# $NetBSD: xattr-init.sh,v 1.4 2011/06/06 15:53:14 manu Exp $
GLUSTERFS_XATTR="
trusted.distribute.linkinfo
diff --git a/filesystems/glusterfs/patches/patch-bp b/filesystems/glusterfs/patches/patch-bp
new file mode 100644
index 00000000000..b1b5c424317
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-bp
@@ -0,0 +1,19 @@
+$NetBSD: patch-bp,v 1.1 2011/06/06 15:53:14 manu Exp $
+
+NetBSD does not have umount(2), but unmount(2)
+
+--- xlators/mgmt/glusterd/src/glusterd-op-sm.c.orig 2011-06-02 10:19:31.000000000 +0200
++++ xlators/mgmt/glusterd/src/glusterd-op-sm.c 2011-06-02 10:20:33.000000000 +0200
+@@ -49,8 +49,12 @@
+ #include "syscall.h"
+ #include "cli1.h"
+ #include "common-utils.h"
+
++#ifdef __NetBSD__
++#define umount(path) unmount(path,0)
++#endif /* __NetBSD__ */
++
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <sys/wait.h>
+ #define glusterd_op_start_volume_args_get(dict, volname, flags) \
diff --git a/filesystems/glusterfs/patches/patch-bq b/filesystems/glusterfs/patches/patch-bq
new file mode 100644
index 00000000000..e2d953d9557
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-bq
@@ -0,0 +1,101 @@
+$NetBSD: patch-bq,v 1.1 2011/06/06 15:53:14 manu Exp $
+
+Make sur glusterfsd uses the same address family as gluserd.
+
+glusterfsd uses getaddrinfo and picks the first entry for its
+listening address. The first entru is of inet7 family on
+NetBSD. Even if glusterd was started with option
+transport.address-family inet, we ended with glusterfsd
+started with inet6, and the client could not connect to it
+if the letwork lack IPv6
+
+--- xlators/mgmt/glusterd/src/glusterd-utils.c.orig 2011-06-06 10:28:42.000000000 +0200
++++ xlators/mgmt/glusterd/src/glusterd-utils.c 2011-06-06 16:17:30.000000000 +0200
+@@ -88,8 +88,52 @@
+ //TODO: set timestamp
+ return 0;
+ }
+
++static const char *
++glusterd_listener_family_name(void)
++{
++ xlator_t *this = NULL;
++ glusterd_conf_t *conf = NULL;
++ rpcsvc_listener_t *listener = NULL;
++ struct sockaddr_storage ss;
++
++ this = THIS;
++ GF_ASSERT (this);
++ conf = this->private;
++ GF_ASSERT (conf);
++ GF_ASSERT (conf->rpc);
++
++ list_for_each_entry (listener, &conf->rpc->listeners, list)
++ break; /* grab first one */
++
++ GF_ASSERT (listener->trans);
++
++ if (rpc_transport_get_myaddr(listener->trans, NULL, 0,
++ &ss, sizeof(ss)) != 0) {
++ gf_log ("glusterd", GF_LOG_ERROR,
++ "rpc_transport_get_myname failed: %s",
++ strerror(errno));
++ return NULL;
++ }
++
++ switch (ss.ss_family) {
++ case AF_INET:
++ return "inet";
++ break;
++ case AF_INET6:
++ return "inet6";
++ break;
++ default:
++ gf_log ("glusterd", GF_LOG_ERROR,
++ "unknown address family %d",
++ ss.ss_family);
++ break;
++ }
++
++ return NULL;
++}
++
+ gf_boolean_t
+ glusterd_is_loopback_localhost (const struct sockaddr *sa, char *hostname)
+ {
+ GF_ASSERT (sa);
+@@ -1026,8 +1070,10 @@
+ int port = 0;
+ FILE *file = NULL;
+ gf_boolean_t is_locked = _gf_false;
+ char socketpath[PATH_MAX] = {0};
++ const char *family_name;
++ char *family_option[8192] = {0,};
+
+ GF_ASSERT (volinfo);
+ GF_ASSERT (brickinfo);
+
+@@ -1106,14 +1152,19 @@
+ port = brickinfo->port;
+ if (!port)
+ port = pmap_registry_alloc (THIS);
+
++ if ((family_name = glusterd_listener_family_name()) != NULL)
++ snprintf (family_option, 8192,
++ "--xlator-option %s-server.transport.address-family=%s ",
++ volinfo->volname, family_name);
++
+ snprintf (cmd_str, 8192,
+ "%s/sbin/glusterfsd --xlator-option %s-server.listen-port=%d "
+- "-s localhost --volfile-id %s -p %s -S %s --brick-name %s "
+- "--brick-port %d -l %s", GFS_PREFIX, volinfo->volname,
+- port, volfile, pidfile, socketpath, brickinfo->path, port,
+- brickinfo->logfile);
++ "%s -s localhost --volfile-id %s -p %s -S %s --brick-name %s "
++ "--brick-port %d -l %s", GFS_PREFIX, volinfo->volname, port,
++ family_option, volfile, pidfile, socketpath, brickinfo->path,
++ port, brickinfo->logfile);
+
+ gf_log ("",GF_LOG_DEBUG,"Starting GlusterFS Command Executed: \n %s \n", cmd_str);
+ ret = gf_system (cmd_str);
+