summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-23 02:34:44 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-23 02:34:44 +0000
commitc542aed4d22669f6d6452df607a99564c084ff7d (patch)
tree6925666cd30b8c507b8c56687efa0040c81b493c /sys-cluster
parent(Portage version: 2.0.51.19) (Manifest recommit) (diff)
downloadgentoo-2-c542aed4d22669f6d6452df607a99564c084ff7d.tar.gz
gentoo-2-c542aed4d22669f6d6452df607a99564c084ff7d.tar.bz2
gentoo-2-c542aed4d22669f6d6452df607a99564c084ff7d.zip
new in portage
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/gnbd/ChangeLog11
-rw-r--r--sys-cluster/gnbd/Manifest8
-rw-r--r--sys-cluster/gnbd/files/digest-gnbd-1.0_pre131
-rwxr-xr-xsys-cluster/gnbd/files/gnbd-client.rc50
-rwxr-xr-xsys-cluster/gnbd/files/gnbd-srv.rc81
-rw-r--r--sys-cluster/gnbd/files/gnbd.devfs21
-rw-r--r--sys-cluster/gnbd/files/gnbdtab9
-rw-r--r--sys-cluster/gnbd/gnbd-1.0_pre13.ebuild46
-rw-r--r--sys-cluster/gnbd/metadata.xml8
9 files changed, 235 insertions, 0 deletions
diff --git a/sys-cluster/gnbd/ChangeLog b/sys-cluster/gnbd/ChangeLog
new file mode 100644
index 000000000000..7b00859b3a7f
--- /dev/null
+++ b/sys-cluster/gnbd/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-cluster/gnbd
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/ChangeLog,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+
+*gnbd-1.0_pre13 (23 Mar 2005)
+
+ 23 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> +metadata.xml,
+ +files/gnbd-client.rc, +files/gnbd-srv.rc, +files/gnbd.devfs, +files/gnbdtab,
+ +gnbd-1.0_pre13.ebuild:
+ new in portage
+
diff --git a/sys-cluster/gnbd/Manifest b/sys-cluster/gnbd/Manifest
new file mode 100644
index 000000000000..045b3a8d1870
--- /dev/null
+++ b/sys-cluster/gnbd/Manifest
@@ -0,0 +1,8 @@
+MD5 b5f226ae4be0405e5b1214f0fa3f70a8 ChangeLog 335
+MD5 a64b9a1937a5cfc2fbaf373521f65d47 metadata.xml 223
+MD5 5d0c082adb5fe200f1a471bc77907f54 gnbd-1.0_pre13.ebuild 941
+MD5 65610c3f60f81c1888e72e04ce7bcd4e files/gnbd-client.rc 1169
+MD5 c61cd582c8f8b9b4295e994931f2ba49 files/gnbd-srv.rc 1844
+MD5 a96ced2be5dbc837a2d23bd3fbecaa12 files/gnbd.devfs 332
+MD5 79b84f9fc4b7bdee59dd1211663aef8d files/gnbdtab 177
+MD5 59f3ca3db34191305528a95653f41692 files/digest-gnbd-1.0_pre13 65
diff --git a/sys-cluster/gnbd/files/digest-gnbd-1.0_pre13 b/sys-cluster/gnbd/files/digest-gnbd-1.0_pre13
new file mode 100644
index 000000000000..ff5a77e8a6f8
--- /dev/null
+++ b/sys-cluster/gnbd/files/digest-gnbd-1.0_pre13
@@ -0,0 +1 @@
+MD5 e8c4807be08c0af8da09646f2a85f8e0 gnbd-1.0-pre13.tar.gz 57522
diff --git a/sys-cluster/gnbd/files/gnbd-client.rc b/sys-cluster/gnbd/files/gnbd-client.rc
new file mode 100755
index 000000000000..95c51fee400c
--- /dev/null
+++ b/sys-cluster/gnbd/files/gnbd-client.rc
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/files/gnbd-client.rc,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+
+depend() {
+ use dns logger
+ need net
+ need fenced
+}
+
+start() {
+ if [ ! -f /etc/gnbdtab ] ; then
+ eerror "Please create /etc/gnbdtab"
+ eerror "Sample conf: /etc/gnbdtab"
+ return 1
+ fi
+
+ ebegin "Loading needed kernel modules for gnbd"
+ modprobe gnbd
+ eend $? "Failed to load needed kernel modules for gnbd"
+
+ GNBD=`cat /etc/gnbdtab | egrep '^import'`
+ if [ -n "$GNBD" ] ; then
+ ebegin "Importing all GNBDs devices"
+ einfo "$(awk '/^import/ { print "--> server:", $2 }' /etc/gnbdtab )"
+ cat /etc/gnbdtab | awk '/^import/ { print "-i", $2 }' | xargs gnbd_import > /dev/null
+ eend $? "Failed to import gnbd devices"
+ fi
+}
+
+stop() {
+
+ local GNBD_MONITOR_PROC
+
+ ebegin "Unimporting all GNBDs devices"
+ gnbd_import -q -R &> /dev/null
+ eend $?
+
+ GNBD_MONITOR_PROC="$(pgrep gnbd_clusterd)"
+ if [ -n "${GNBD_MONITOR_PROC}" ]; then
+ ebegin "Stopping gnbd_monitor"
+ killall gnbd_monitor &> /dev/null
+ eend $?
+ fi
+
+ ebegin "Unloading gnbd kernel module"
+ modprobe -r gnbd
+ eend $? "Failed to unload gnbd kernel module"
+}
diff --git a/sys-cluster/gnbd/files/gnbd-srv.rc b/sys-cluster/gnbd/files/gnbd-srv.rc
new file mode 100755
index 000000000000..707624b85956
--- /dev/null
+++ b/sys-cluster/gnbd/files/gnbd-srv.rc
@@ -0,0 +1,81 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/files/gnbd-srv.rc,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+
+depend() {
+ use dns logger
+ need net
+ need fenced
+}
+
+GNBD_SRV_TIMEOUT=5
+
+start() {
+ local GNBD
+
+ if [ ! -f /etc/gnbdtab ] ; then
+ eerror "Please create /etc/gnbdtab"
+ eerror "Sample conf: /etc/gnbdtab"
+ return 1
+ fi
+
+ ebegin "Loading needed kernel modules for gnbd"
+ modprobe gnbd
+ eend $? "Failed to load needed kernel modules for gnbd"
+
+ ebegin "Starting gnbd_serv"
+ start-stop-daemon --start --quiet --exec /sbin/gnbd_serv -- -q
+ eend $? "Failed to start gnbd_serv"
+
+ GNBD=`cat /etc/gnbdtab | egrep '^export'`
+ if [ -n "$GNBD" ] ; then
+ ebegin "Exporting gnbd devices"
+ einfo "$(awk '/^export/ { print "--> device:", $4, "as", $3 }' /etc/gnbdtab )"
+ cat /etc/gnbdtab | awk '/^export/ { print "-d", $4, "-e", $3 }' | xargs gnbd_export > /dev/null
+ eend $? "Failed to export gnbd devices"
+ fi
+}
+
+stop() {
+
+ local GNBD_SRV_PROCS GNBD_CLUSTERD_PROC
+
+ ebegin "Unexporting all gnbd devices"
+ gnbd_export -q -R &> /dev/null
+ eend $?
+
+ if [ "$?" -ne 0 ]
+ then
+ ewend 1 "Failed to unexport all gnbd devices"
+ else
+ eend 0
+
+ fi
+
+ ebegin "Stopping gnbd_serv"
+
+ GNBD_SRV_PROCS="$(pgrep gnbd_serv)"
+ while [ -n "${GNBD_SRV_PROCS}" ] && [ ${GNBD_SRV_TIMEOUT} -gt 0 ] ; do
+ gnbd_serv -k &> /dev/null
+ sleep 1
+ GNBD_SRV_TIMEOUT=$(( ${GNBD_SRV_TIMEOUT}-1 ))
+ GNBD_SRV_PROCS="$(pgrep gnbd_serv)"
+ done
+
+ if [ -n "${GNBD_SRV_PROCS}" ]; then
+ gnbd_serv -K &> /dev/null
+ fi
+ eend $? "Failed to stop gnbd_serv"
+
+ GNBD_CLUSTERD_PROC="$(pgrep gnbd_clusterd)"
+ if [ -n "${GNBD_CLUSTERD_PROC}" ]; then
+ ebegin "Stopping gnbd_clusterd"
+ killall gnbd_clusterd &> /dev/null
+ eend $?
+ fi
+
+ ebegin "Unloading gnbd kernel module"
+ modprobe -r gnbd
+ eend $? "Failed to unload gnbd kernel module"
+}
diff --git a/sys-cluster/gnbd/files/gnbd.devfs b/sys-cluster/gnbd/files/gnbd.devfs
new file mode 100644
index 000000000000..f501682a9fb5
--- /dev/null
+++ b/sys-cluster/gnbd/files/gnbd.devfs
@@ -0,0 +1,21 @@
+#
+# GNBD
+#
+
+#LOOKUP ^gnbd.* MODLOAD
+
+#
+# gnbd needs crx------- on /dev/gnbd_ctl
+#
+
+REGISTER ^gnbd_ctl PERMISSIONS root.root 600
+
+#
+# create old style device for /dev/gnbd/.*
+#
+
+#REGISTER ^gnbd/.* MKOLDCOMPAT
+#UNREGISTER ^gnbd/.* RMOLDCOMPAT
+
+#REGISTER ^gnbd.* IGNORE
+#REGISTER ^gnbd/.* IGNORE
diff --git a/sys-cluster/gnbd/files/gnbdtab b/sys-cluster/gnbd/files/gnbdtab
new file mode 100644
index 000000000000..e9a29dc59139
--- /dev/null
+++ b/sys-cluster/gnbd/files/gnbdtab
@@ -0,0 +1,9 @@
+#
+# GNBD filesystem import/export configuration
+#
+
+# type host name device
+
+# Samples:
+# export srv1 export1 /dev/data/export1
+# import srv3 export1 /dev/gnbd/export1
diff --git a/sys-cluster/gnbd/gnbd-1.0_pre13.ebuild b/sys-cluster/gnbd/gnbd-1.0_pre13.ebuild
new file mode 100644
index 000000000000..36e2f7bf0376
--- /dev/null
+++ b/sys-cluster/gnbd/gnbd-1.0_pre13.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/gnbd-1.0_pre13.ebuild,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+
+MY_PV="${PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GFS Network Block Devices"
+HOMEPAGE="http://sources.redhat.com/cluster/"
+#SRC_URI="http://people.redhat.com/cfeist/cluster/tgz/${MY_P}.tar.gz"
+
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz
+ http://dev.gentoo.org/~xmerlin/gfs/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+
+DEPEND=">=sys-cluster/magma-1.0_pre8
+ >=sys-cluster/gnbd-kernel-2.6.9-r1"
+
+
+S="${WORKDIR}/${MY_P}"
+
+src_compile() {
+ ./configure || die
+ emake || die
+}
+
+src_install() {
+ make DESTDIR=${D} install || die
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/gnbd-client.rc gnbd-client || die
+ newexe ${FILESDIR}/gnbd-srv.rc gnbd-srv || die
+
+ insinto /etc
+ doins ${FILESDIR}/gnbdtab
+
+ if $(has_version sys-fs/devfsd ) ; then
+ insinto /etc/devfs.d/
+ newins ${FILESDIR}/gnbd.devfs gnbd
+ fi
+}
diff --git a/sys-cluster/gnbd/metadata.xml b/sys-cluster/gnbd/metadata.xml
new file mode 100644
index 000000000000..e2b45fb75fca
--- /dev/null
+++ b/sys-cluster/gnbd/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<maintainer>
+ <email>cluster@gentoo.org</email>
+</maintainer>
+</pkgmetadata>