[sys-fs/ocfs2-tools] Reimport to tree
authorAlexey Shvetsov <alexxy@gentoo.org>
Wed, 31 Aug 2011 17:15:18 +0000 (17:15 +0000)
committerAlexey Shvetsov <alexxy@gentoo.org>
Wed, 31 Aug 2011 17:15:18 +0000 (17:15 +0000)
Package-Manager: portage-2.2.0_alpha51/cvs/Linux x86_64

sys-fs/ocfs2-tools/ChangeLog [new file with mode: 0644]
sys-fs/ocfs2-tools/Manifest [new file with mode: 0644]
sys-fs/ocfs2-tools/files/ocfs2.confd [new file with mode: 0644]
sys-fs/ocfs2-tools/files/ocfs2.initd [new file with mode: 0644]
sys-fs/ocfs2-tools/metadata.xml [new file with mode: 0644]
sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild [new file with mode: 0644]

diff --git a/sys-fs/ocfs2-tools/ChangeLog b/sys-fs/ocfs2-tools/ChangeLog
new file mode 100644 (file)
index 0000000..7b6efdb
--- /dev/null
@@ -0,0 +1,10 @@
+# ChangeLog for sys-fs/ocfs2-tools
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/ChangeLog,v 1.6 2011/08/31 17:15:18 alexxy Exp $
+
+*ocfs2-tools-1.6.4 (31 Aug 2011)
+
+  31 Aug 2011; Alexey Shvetsov <alexxy@gentoo.org> +files/ocfs2.confd,
+  +ocfs2-tools-1.6.4.ebuild, +files/ocfs2.initd, +metadata.xml:
+  reimport to tree
+
diff --git a/sys-fs/ocfs2-tools/Manifest b/sys-fs/ocfs2-tools/Manifest
new file mode 100644 (file)
index 0000000..e5d3472
--- /dev/null
@@ -0,0 +1,26 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+AUX ocfs2.confd 1605 RMD160 18f07f87a57dc0c385996b5e28eeef9460ef8917 SHA1 295520b6dc716285390289835ca67b45e1cbe7bf SHA256 2fef37296825b1c2df2084cf4392ae555b68860aa0f673b93bec54c044f81dcf
+AUX ocfs2.initd 4114 RMD160 adf28acd493e7572fe9474ea1e45a8b258a209eb SHA1 1ac80848e784dcbc5d4dac4c9bcaf71eb3dcd006 SHA256 8be50bd1c1747896769447b56f289cdd9b1477268348b293c4b1224df22ed430
+DIST ocfs2-tools-1.6.4.tar.gz 823914 RMD160 c8b65f4c26017e257c4190322d6df64e9ef7925b SHA1 1409a13f63b55457a474c5f5662260e420452ee9 SHA256 dda9db208312e3e5f4f55ee77e66e7b35b9cc10421bc02065a6c168e42b24755
+EBUILD ocfs2-tools-1.6.4.ebuild 1646 RMD160 1d3ea6f882814a408014397ae73673d7f723d2f8 SHA1 27f21b935f26df74650f83f8bdf5f23f4d6b2cab SHA256 0a90f946b7305a7bb1d3d90d3bdcb7b5869e5555ba28e8f2d88f1b191b8ccdf6
+MISC ChangeLog 398 RMD160 7890f97856090e75e764fb0eb8cdcff5f087483f SHA1 abfa71d604b7f763819e97f8a3619b4b107cd816 SHA256 92e2c48d15fc00a527ce6000881dfcf858a17d51bbd5af55ad6a1cdb47b73633
+MISC metadata.xml 318 RMD160 125e0bce8608c63cfac4690707384f4b9a5118ec SHA1 99e5d8c06141cc6cfb6b5d21be8ed7236b718466 SHA256 4adb0813c6bc1eb64cef456f02e0fe3488b2c497ac4d5612b55d235be981dc07
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iQIcBAEBCAAGBQJOXmwXAAoJEOf+E+/4L5LmtjAP/juDMvWvob/OQ1YBIUqJe/fx
+IfmMpdG92njp0/5UqP988W6nM4jB5olwlp8d+gyiuyTKP4ItWADuTeETevhX8usA
+q+n9xrQ1LbOxV4M00W2dkWa1Pvmeban8NfdME/wa8NwMuIDErR43qQ9MbAKvtrpN
+Wa8RoeV+u0Smf+alJAciIpc34nI4dp28+Ui4/RuCSmy3dLM/m+u/bbie47m9elDz
+1xIiVf3ZqXo7PM/q52JDN/bekqAYcAN8wrj3BeQ0WzA1Ku81pcdnf3w6dOls5CO1
+sYuiZWkakdQPp3W8TOBhk1W421INeeDmPMhoV7e7GAllvdRCTLswY1/5pFYH2tLH
+A5CDFg7+10z7ZilJ9LvlfpPwJWp2teZvovKF64gtVU5cFU+JKRTxrpN5vSrWyC9y
+Z6bBhTSMrL8rNkOX+zHShdxSp8dCnyKqU+Cby1l8TLmHCZFFlYDKz+f5gqHsTmLa
+g3BgrV9b0TaVx4fJO6MzI2pyvcRdsHtoEfh6TwsL8O98pTjMiLAGxceIAL+9rW81
+2W9fSmBl92BbReC3pH+p22oTRWvO8wJ8IlVr+8I8DqVLCPlaHiJ6Ke8croudig8T
+VNacfceDVamkeX9my8tX7WRKHKAC/RDAQhkke81gQPo2nzqdwU6Ap4Lq0WRmGKz9
+SilKb5se1CdCFf/JlMM5
+=s6t6
+-----END PGP SIGNATURE-----
diff --git a/sys-fs/ocfs2-tools/files/ocfs2.confd b/sys-fs/ocfs2-tools/files/ocfs2.confd
new file mode 100644 (file)
index 0000000..9926389
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/files/ocfs2.confd,v 1.1 2011/08/31 17:15:18 alexxy Exp $
+
+# Put your cluster names here, separated by space, ie.
+# OCFS2_CLUSTER="cluster1 admincluster cluster2" 
+OCFS2_CLUSTER="home"
+
+# 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.
+OCFS2_IDLE_TIMEOUT_MS="30000"
+# How often we should attempt to send heartbeats.
+OCFS2_KEEPALIVE_DELAY_MS="2000"
+OCFS2_RECONNECT_DELAY_MS="2000"
+# How often we should attempt to send heartbeats.
+# How many interations before a node is considered dead from lack of IO activity.
+# (dead_threshold - 1) * 2s
+OCFS2_DEAD_THRESHOLD="61"
+
+# Default: "-fy" (force check on double-unmounted boot). I beleave this is best.
+# Native way is "-y", but once I have twice reboot/powerOFF with bad result...
+# Affected only fstab.
+OCFS2_FSCK="-fy"
+
+# http://oss.oracle.com/projects/ocfs2-tools/news/article_8.html
+# starting from 1.4.3, fsck.ocfs2 "aggressively cache the metadata blocks"
+# this is useful on lots of free memory, but I have heavy slowdown on x86_64
+# with 1G of RAM.
+# "yes" will "swapoff -a" & "swapon -a" around fsck to avoid caching over swap
+OCFS2_FSCK_SWAPOFF="yes"
+
+# Signal to kill processes on stop/umount on busy device (empty to not kill)
+#OCFS2_UMOUNT_KILL="KILL"
+
+# "yes" to force stop
+#OCFS2_FORCE_STOP="no"
diff --git a/sys-fs/ocfs2-tools/files/ocfs2.initd b/sys-fs/ocfs2-tools/files/ocfs2.initd
new file mode 100644 (file)
index 0000000..fecca7d
--- /dev/null
@@ -0,0 +1,125 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/files/ocfs2.initd,v 1.1 2011/08/31 17:15:18 alexxy Exp $
+
+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/metadata.xml b/sys-fs/ocfs2-tools/metadata.xml
new file mode 100644 (file)
index 0000000..3797def
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<maintainer>
+       <email>alexxy@gentoo.org</email>
+       <name>Alexey Shvetsov</name>
+</maintainer>
+<use>
+       <flag name='external'>Enable external locking</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild b/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild
new file mode 100644 (file)
index 0000000..2110c4f
--- /dev/null
@@ -0,0 +1,68 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/ocfs2-tools-1.6.4.ebuild,v 1.1 2011/08/31 17:15:18 alexxy Exp $
+
+EAPI=3
+PYTHON_DEPEND="gtk? 2"
+inherit base python 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 external gtk"
+
+RDEPEND="
+       sys-apps/util-linux
+       sys-cluster/cman-lib
+       external?  (
+                               || ( sys-cluster/corosync sys-cluster/openais sys-cluster/dlm-lib )
+                               )
+       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}"
+
+DOCS=(
+       "${S}/documentation/samples/cluster.conf"
+       "${S}/documentation/users_guide.txt"
+)
+
+MAKEOPTS+=" -j1"
+
+pkg_setup() {
+       python_set_active_version 2
+       python_pkg_setup
+}
+
+src_prepare() {
+       # gentoo uses /sys/kernel/dlm as dlmfs mountpoint
+       sed -e 's:"/dlm/":"/sys/kernel/dlm":g' \
+               -i libo2dlm/o2dlm_test.c \
+               -i libocfs2/dlm.c || die "sed failed"
+}
+
+src_configure() {
+       econf \
+               $(use_enable debug debug) \
+               $(use_enable debug debugexe) \
+               $(use_enable gtk ocfs2console) \
+               --enable-dynamic-fsck \
+               --enable-dynamic-ctl
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die
+       newinitd "${FILESDIR}/ocfs2.initd" ocfs2  || die
+       newconfd "${FILESDIR}/ocfs2.confd" ocfs2  || die
+}