public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexey Shvetsov" <alexxy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sys-fs/ocfs2-tools/files/, sys-fs/ocfs2-tools/
Date: Wed, 22 Jun 2011 15:17:01 +0000 (UTC)	[thread overview]
Message-ID: <6548fa4ba584a16b1202ad1a938c6d8e7d0fa2d6.alexxy@gentoo> (raw)

commit:     6548fa4ba584a16b1202ad1a938c6d8e7d0fa2d6
Author:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 22 15:16:32 2011 +0000
Commit:     Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Wed Jun 22 15:16:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=6548fa4b

Update init.d

---
 sys-fs/ocfs2-tools/files/1.4.4-cpg.patch    |   31 -------
 sys-fs/ocfs2-tools/files/1.4.4-gcc45.patch  |   21 -----
 sys-fs/ocfs2-tools/files/ocfs2.init         |  125 +++++++++++++++++++++++++++
 sys-fs/ocfs2-tools/ocfs2-tools-1.4.4.ebuild |   58 ------------
 sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild |    5 +
 5 files changed, 130 insertions(+), 110 deletions(-)

diff --git a/sys-fs/ocfs2-tools/files/1.4.4-cpg.patch b/sys-fs/ocfs2-tools/files/1.4.4-cpg.patch
deleted file mode 100644
index 4832bf7..0000000
--- a/sys-fs/ocfs2-tools/files/1.4.4-cpg.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- ocfs2-tools-1.4.4-buggy/configure	2010-10-04 18:10:31.327238001 +0200
-+++ ocfs2-tools-1.4.4/configure	2010-10-05 10:27:52.607238001 +0200
-@@ -5534,7 +5534,12 @@
- echo $ECHO_N "checking for cpg_initialize in -lcpg... $ECHO_C" >&6
-     while test "x$TRY_PATH" != "x"; do
-         TRY="`echo $TRY_PATH | cut -f1 -d:`"
--        TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
-+        NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
-+        if test "x$NEW_TRY_PATH" != "x$TRY_PATH"; then
-+            TRY_PATH="$NEW_TRY_PATH"
-+        else
-+            TRY_PATH=""
-+        fi
- 
-         if test "x$TRY" != "x"; then
-             TRY="-L${TRY}/${cpg_package}"
-@@ -5680,7 +5685,13 @@
- echo $ECHO_N "checking for saCkptInitialize in -lSaCkpt... $ECHO_C" >&6
-     while test "x$TRY_PATH" != "x"; do
-         TRY="`echo $TRY_PATH | cut -f1 -d:`"
--        TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
-+        NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
-+        if test "x$NEW_TRY_PATH" != "x$TRY_PATH"; then
-+            TRY_PATH="$NEW_TRY_PATH"
-+        else
-+            TRY_PATH=""
-+        fi
-+	
- 
-         if test "x$TRY" != "x"; then
-             TRY="-L${TRY}/openais"

diff --git a/sys-fs/ocfs2-tools/files/1.4.4-gcc45.patch b/sys-fs/ocfs2-tools/files/1.4.4-gcc45.patch
deleted file mode 100644
index 0db24f4..0000000
--- a/sys-fs/ocfs2-tools/files/1.4.4-gcc45.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -urN ocfs2-tools-1.4.3.orig//mount.ocfs2/mount.ocfs2.c ocfs2-tools-1.4.3/mount.ocfs2/mount.ocfs2.c
---- ocfs2-tools-1.4.3.orig//mount.ocfs2/mount.ocfs2.c	2009-04-14 00:10:40.000000000 +0200
-+++ ocfs2-tools-1.4.3/mount.ocfs2/mount.ocfs2.c	2010-03-24 07:23:45.000000000 +0100
-@@ -261,7 +261,7 @@
- 	char *extra = NULL;
- 	int dev_ro = 0;
- 	char *hbstr = NULL;
--	char stackstr[strlen(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN + 1] = "";
-+	char stackstr[strlen(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN + 1];
- 	ocfs2_filesys *fs = NULL;
- 	struct o2cb_cluster_desc cluster;
- 	struct o2cb_region_desc desc;
-@@ -269,6 +269,8 @@
- 	int hb_started = 0;
- 	struct stat statbuf;
- 
-+	stackstr[0] = '\0';
-+
- 	initialize_ocfs_error_table();
- 	initialize_o2dl_error_table();
- 	initialize_o2cb_error_table();

diff --git a/sys-fs/ocfs2-tools/files/ocfs2.init b/sys-fs/ocfs2-tools/files/ocfs2.init
new file mode 100644
index 0000000..631c9bf
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2.init
@@ -0,0 +1,125 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+	need net localmount
+	before netmount 
+}
+
+check_modules_config() {
+	local MODULES=$1
+	local CONFIGS=$2
+	local MODULE
+	local retval=0
+	
+	for MODULE in ${MODULES}; do
+		if ! ls -1 /sys/module | egrep -q "^${MODULE}$"; then
+			retval=1
+		fi
+	done
+	if [ ${retval} -eq 1 ] && [ -e /proc/config.gz ]; then
+		retval=0
+		for MODULE in ${CONFIGS}; do
+			if ! gzip -dc /proc/config.gz | egrep -q "^CONFIG_${MODULE}=y$"; then
+				retval=1
+			fi
+		done
+	fi
+	return ${retval}
+}
+
+check_modules() {
+	check_modules_config "ocfs2_dlmfs ocfs2 ocfs2_dlm ocfs2_nodemanager" "OCFS2_FS OCFS2_FS_O2CB" && check_modules_config configfs CONFIGFS_FS && return 0
+	if ! egrep -q '\s*ocfs2\s*$' /proc/filesystems || ! egrep -q '\s*ocfs2_dlmfs\s*$' /proc/filesystems; then 
+		ewarn "One or more required modules are not loaded."
+                ewarn "Make sure you have "
+                ewarn " - placed ocfs, dlmfs and configfs into /etc/modules.autoload.d/kernel-2.6 or built directly into the kernel."
+                ewarn "For a (in)complete documentation, read /usr/share/doc/ocfs-<version>/INSTALL.GENTOO.bz2"
+	fi
+	return 1
+}
+
+check_pseudofs() { 
+	local retval=0
+	local HASMOUNT="mount -l -t"
+	if [ -z "`${HASMOUNT} configfs`" ] ; then
+		retval=1
+	fi
+	if [ -z "`${HASMOUNT} ocfs2_dlmfs`" ] ; then
+		retval=1
+	fi
+
+	if [ ${retval} -eq 1 ]; then
+		ewarn "One or more pseudo-filesystes are not mounted."
+		ewarn "Make sure you have following lines in your /etc/fstab:"
+		ewarn "none         /sys/kernel/config         configfs        defaults                0 0"
+		ewarn "none         /sys/kernel/dlm            ocfs2_dlmfs     defaults                0 0"
+	fi
+	return ${retval}
+}
+
+
+
+start() {
+	check_modules || return $? 
+	check_pseudofs || return $?
+	
+	einfo "Starting OCFS2 cluster"
+	for cluster in ${OCFS2_CLUSTER}; do
+		ebegin " - ${cluster}"
+		/sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=yes >/dev/null 2>&1
+		eend $?
+
+		# Some heartbeat tweaks to prevent self-fencing quite so much during heavy load.
+		# http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html
+
+		# How long to wait before a node is considered dead from lack of network activity.
+		echo $OCFS2_IDLE_TIMEOUT_MS > /sys/kernel/config/cluster/${cluster}/idle_timeout_ms
+		# How often we should attempt to send heartbeats.
+		echo $OCFS2_KEEPALIVE_DELAY_MS > /sys/kernel/config/cluster/${cluster}/keepalive_delay_ms
+		echo $OCFS2_RECONNECT_DELAY_MS > /sys/kernel/config/cluster/${cluster}/reconnect_delay_ms
+		# How many interations before a node is considered dead from lack of IO activity.
+		# (dead_threshold - 1) * 2s
+		echo $OCFS2_DEAD_THRESHOLD > /sys/kernel/config/cluster/${cluster}/heartbeat/dead_threshold
+	done
+	sleep 2
+}
+
+stop() {
+	# Shamelesly stolen from netmount
+        local ret
+        ebegin "Unmounting OCFS2 filesystems"
+        [ -z "$(umount -art ocfs2 2>&1)" ]
+        ret=$?
+        eend ${ret} "Failed to simply unmount filesystems"
+        [ ${ret} -eq 0 ] && return 0
+
+        declare -a siglist=( "TERM" "KILL" "KILL" )
+        local retry=0
+        local remaining="go"
+
+        while [ -n "${remaining}" -a ${retry} -lt 3 ]
+        do
+                remaining="$(awk '$3 ~ /'ocfs2'/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+                IFS=$'\n'
+                set -- ${remaining//\\040/ }
+                unset IFS
+                [ -z "${remaining}" ] && break
+
+                ebegin $'\t'"Unmounting ocfs2 filesystems (retry #$((retry+1)))"
+                /bin/fuser -k -${siglist[$((retry++))]} -m "$@" &>/dev/null
+                sleep 5
+                umount "$@" &>/dev/null
+                eend $? $'\t'"Failed to unmount filesystems"
+        done
+
+	
+	einfo "Stopping OCFS2 cluster" 
+	for cluster in ${OCFS_CLUSTERS}; do
+		ebegin " - ${cluster}"
+		/sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=no >/dev/null 2>&1
+		eend $?
+	done
+}

diff --git a/sys-fs/ocfs2-tools/ocfs2-tools-1.4.4.ebuild b/sys-fs/ocfs2-tools/ocfs2-tools-1.4.4.ebuild
deleted file mode 100644
index 26aaeaf..0000000
--- a/sys-fs/ocfs2-tools/ocfs2-tools-1.4.4.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI=3
-PYTHON_DEPEND="gtk? 2"
-inherit python base versionator
-
-DESCRIPTION="Support programs for the Oracle Cluster Filesystem 2"
-HOMEPAGE="http://oss.oracle.com/projects/ocfs2-tools/"
-SRC_URI="http://oss.oracle.com/projects/${PN}/dist/files/source/v$(get_version_component_range 1-2)/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug gtk"
-
-RDEPEND="
-	sys-apps/util-linux
-	sys-cluster/cman-lib
-	|| ( sys-cluster/corosync sys-cluster/openais )
-	sys-fs/e2fsprogs
-	sys-libs/ncurses
-	sys-libs/readline
-	sys-process/psmisc
-	gtk? (
-		dev-python/pygtk
-	)
-"
-# 99% of deps this thing has is automagic
-# specialy cluster things corosync/pacemaker
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}/${PV}-gcc45.patch"
-	"${FILESDIR}/${PV}-cpg.patch"
-)
-
-DOCS=(
-	"${S}/documentation/samples/cluster.conf"
-	"${S}/documentation/users_guide.txt"
-)
-
-MAKEOPTS+=" -j1"
-
-pkg_setup() {
-	python_set_active_version 2
-	python_pkg_setup
-}
-
-src_configure() {
-	econf \
-		$(use_enable debug debug) \
-		$(use_enable debug debugexe) \
-		$(use_enable gtk ocfs2console) \
-		--enable-dynamic-fsck \
-		--enable-dynamic-ctl
-}

diff --git a/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild b/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild
index bb85668..68e27a5 100644
--- a/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild
+++ b/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild
@@ -53,3 +53,8 @@ src_configure() {
 		--enable-dynamic-fsck \
 		--enable-dynamic-ctl
 }
+
+src_install() {
+	base-src_install
+	newinitd "${FILESDIR}/ocfs2.init"
+}



             reply	other threads:[~2011-06-22 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 15:17 Alexey Shvetsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-14 15:51 [gentoo-commits] proj/sci:master commit in: sys-fs/ocfs2-tools/files/, sys-fs/ocfs2-tools/ Alexey Shvetsov
2011-06-22 13:49 Alexey Shvetsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6548fa4ba584a16b1202ad1a938c6d8e7d0fa2d6.alexxy@gentoo \
    --to=alexxy@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox