Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (f24ff38efcc96bd9e90277b82dd0b98174930699)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (f24ff38efcc96bd9e90277b82dd0b98174930699)
  • Date: Fri, 14 Jan 2011 22:50:24 -0600

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

cluster/drbd/BUILD | 2
cluster/drbd/CONFIGURE | 6 -
cluster/drbd/DETAILS | 13 ++
cluster/drbd/HISTORY | 16 +--
cluster/drbd/PRE_BUILD | 4
cluster/drbd/init.d/drbd | 171
++++++++++++++++++++++++++++++++++
cluster/drbd/init.patch | 11 ++
cluster/ocfs2-tools/DETAILS | 6 -
cluster/ocfs2-tools/HISTORY | 5
cluster/ocfs2-tools/INSTALL | 11 ++
cluster/ocfs2-tools/init.d/ocfs2 | 96 +++++++++++++++++++
cluster/ocfs2-tools/init.d/ocfs2.conf | 3
12 files changed, 330 insertions(+), 14 deletions(-)

New commits:
commit f24ff38efcc96bd9e90277b82dd0b98174930699
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

drbd: => 8.3.8.1

commit aee22c9695e07e8d19f3c0fb0f772a967ccbf238
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

ocfs2-tools: added init system

diff --git a/cluster/drbd/BUILD b/cluster/drbd/BUILD
index 2031ac5..bbbdafd 100755
--- a/cluster/drbd/BUILD
+++ b/cluster/drbd/BUILD
@@ -1,3 +1,3 @@
-OPTS="$DRBD_OPTS $OPTS" &&
+OPTS="--with-distro=generic $DRBD_OPTS $OPTS" &&

default_build
diff --git a/cluster/drbd/CONFIGURE b/cluster/drbd/CONFIGURE
index 17f11f6..88b4402 100755
--- a/cluster/drbd/CONFIGURE
+++ b/cluster/drbd/CONFIGURE
@@ -4,4 +4,8 @@ config_query_option DRBD_OPTS "Enable kernel module?" y \

config_query_option DRBD_OPTS "Enable management utilities?" y \
"--with-utils" \
- "--without-utils"
+ "--without-utils" &&
+
+config_query_option DRBD_OPTS "Enable heartbeat integration?" n \
+ "--with-heartbeat" \
+ "--without-heartbeat"
diff --git a/cluster/drbd/DETAILS b/cluster/drbd/DETAILS
index fae73f9..cec2ab0 100755
--- a/cluster/drbd/DETAILS
+++ b/cluster/drbd/DETAILS
@@ -1,12 +1,21 @@
SPELL=drbd
- VERSION=8.3.9
+
+KERNEL_BRANCH=`get_kernel_version|cut -d . -f -3`
+
+if [[ $KERNEL_BRANCH == 2.6.33 ]] || [[ $KERNEL_BRANCH == 2.6.34 ]]; then
+ VERSION=8.3.7
+
SOURCE_HASH=sha512:9ea576ed6a75d80009ade0f9540535b2a65ecee6d38b1a85fa3146a97aac8cb3add31154e2921630aa75121c7115d66bdcf45adb8e0fa481bdb27c011b1c9b15
+else
+ VERSION=8.3.8.1
+
SOURCE_HASH=sha512:c43c6d065328058db66f708d47ce082603b766deb1530c57aa736a42b4908f780ede41f76395ca45c2691ef1dfd142147a4c98a7bcdb26ba7de73b149d8f9f5f
+fi
BRANCH=`echo $VERSION|cut -d . -f 1,2`
SOURCE=${SPELL}-${VERSION}.tar.gz
SOURCE_URL[0]=http://oss.linbit.com/$SPELL/$BRANCH/$SOURCE
-
SOURCE_HASH=sha512:7d6545b3298f2af7cc6ba91a501a15f3232cb914619deae4ff5b09b14d59375015878c8794464cedee298b1209cee60a6bd16cca436471b20c0641cc2a6f2745
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
WEB_SITE=http://www.drbd.org/
ENTERED=20060630
+ DOCS="COPYING README"
LICENSE[0]=GPL
SHORT="block device which is designed to build high availability
clusters"
cat << EOF
diff --git a/cluster/drbd/HISTORY b/cluster/drbd/HISTORY
index d6bd854..9f6d27f 100644
--- a/cluster/drbd/HISTORY
+++ b/cluster/drbd/HISTORY
@@ -1,11 +1,13 @@
-2010-12-08 Vlad Glagolev <stealth AT sourcemage.org>
- * DETAILS: updated spell to 8.3.9; replaced gpg sig with sha512 hash;
- use BRANCH; corrected short desc; quoting paths
- * BUILD: use DRBD_OPTS and default_build
- * DEPENDS: added, for dependencies
- * CONFIGURE: added, for configure options
+2011-01-15 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: updated spell to 8.3.8.1/8.3.7 (use selection depending on
+ installed kernel branch)
+ * init.d/drbd: added init script, adopted for Source Mage
+ * BUILD: use generic distribution set
+ * CONFIGURE: added support for heartbeat integration
+ * PRE_BUILD: added, to apply the patch
+ * init.patch: added, to not install init script in a wrong place

-2010-06-17 Bor Kraljič <pyrobor AT ver.si>
+2010-17-06 Bor Kraljič <pyrobor AT ver.si>
* drbd-0.7.19.tar.gz.sig: resigned sources due to gpg error (bug
#15746)

2006-10-03 Juuso Alasuutari <iuso AT sourcemage.org>
diff --git a/cluster/drbd/PRE_BUILD b/cluster/drbd/PRE_BUILD
new file mode 100755
index 0000000..aab5a70
--- /dev/null
+++ b/cluster/drbd/PRE_BUILD
@@ -0,0 +1,4 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+
+patch -p0 < "$SPELL_DIRECTORY/init.patch"
diff --git a/cluster/drbd/init.d/drbd b/cluster/drbd/init.d/drbd
new file mode 100755
index 0000000..f8395c7
--- /dev/null
+++ b/cluster/drbd/init.d/drbd
@@ -0,0 +1,171 @@
+#!/bin/bash
+
+# Distributed under the terms of the GNU General Public License v2
+#
+# Copyright 2001-2010 LINBIT Information Technologies
+# Philipp Reisner, Lars Ellenberg
+#
+# Copyright 2010-2011 Source Mage Team
+# Vlad Glagolev
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+local_fs +network"
+
+. /etc/init.d/smgl_init
+
+DRBDADM="/sbin/drbdadm"
+DRBDSETUP="/sbin/drbdsetup"
+PROC_DRBD="/proc/drbd"
+MODPROBE="/sbin/modprobe"
+RMMOD="/sbin/rmmod"
+UDEV_TIMEOUT=10
+ADD_MOD_PARAM=""
+
+function assure_module_is_loaded {
+ [ -e "$PROC_DRBD" ] && return
+ echo "Loading drbd module..."
+
+ $MODPROBE -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM || return 1
+
+ return 0
+}
+
+function adjust_with_progress {
+ local IFS_O=$IFS
+ local IFS=$'\n'
+ local res out
+
+ COMMANDS=`$DRBDADM -d -n res adjust all` || return 1
+
+ echo -n "[ "
+
+ for CMD in $COMMANDS; do
+ IFS=$IFS_O
+
+ case "$CMD" in
+ res=*)
+ eval "$CMD"
+ ;;
+ *\ disk\ *)
+ # Check for offline resize. If using internal meta data,
+ # we may need to move it first to its expected location.
+ out=$($DRBDADM check-resize "$res" 2>&1)
+ [[ -z $out ]] ||
+ printf "\n%s\n%s\n" "$res" "$out"
+ echo -n "d($res) "
+ ;;
+ *\ syncer\ *)
+ echo -n "s($res) "
+ ;;
+ *\ net\ *)
+ echo -n "n($res) "
+ ;;
+ *)
+ echo ".. "
+ ;;
+ esac
+
+ if ! eval "$CMD"; then
+ printf "[%s] cmd %s failed - continuing!\n" "$res" "$CMD"
+ fi
+ done
+
+ echo -n "]"
+
+ return 0
+}
+
+start() {
+ # Just in case drbdadm want to display any errors in the configuration
+ # file, or we need to ask the user about registering this installation
+ # at http://usage.drbd.org, we call drbdadm here without any IO
+ # redirection.
+ $DRBDADM sh-nop
+
+ assure_module_is_loaded
+ evaluate_retval
+
+ echo "Starting DRBD resources:"
+
+ adjust_with_progress
+ evaluate_retval
+
+ # make sure udev has time to create the device files
+ echo "Waiting for udev device creation..."
+
+ for RESOURCE in `$DRBDADM sh-resources`; do
+ for DEVICE in `$DRBDADM sh-dev $RESOURCE`; do
+ UDEV_TIMEOUT_LOCAL=$UDEV_TIMEOUT
+ while [[ ! -e $DEVICE ]] && [[ $UDEV_TIMEOUT_LOCAL -gt 0 ]]; do
+ sleep 1
+ UDEV_TIMEOUT_LOCAL=$(( $UDEV_TIMEOUT_LOCAL-1 ))
+ done
+ done
+ done
+
+ echo "Waiting for connection "
+ $DRBDADM wait-con-int # User interruptible version of wait-connect all
+ $DRBDADM sh-b-pri all # Become primary if configured
+
+ evaluate_retval
+}
+
+stop() {
+ $DRBDADM sh-nop
+ echo "Stopping all DRBD resources..."
+
+ if [ -e $PROC_DRBD ]; then
+ # bypass drbdadm and drbd config file and everything,
+ # to avoid leaving devices around that are not referenced by
+ # the current config file, or in case the current config file
+ # does not parse for some reason.
+ for d in /dev/drbd* ; do
+ [ -L "$d" ] && continue
+ [ -b "$d" ] || continue
+
+ M=$(umount "$d" 2>&1)
+
+ case $M in
+ *" not mounted")
+ :
+ ;;
+ *)
+ echo "$M" >&2
+ ;;
+ esac
+
+ $DRBDSETUP "$d" down
+ done
+
+ $RMMOD drbd
+ fi
+
+ evaluate_retval
+}
+
+status() {
+ if [ -e $PROC_DRBD ]; then
+ echo "device status:"
+ cat $PROC_DRBD
+ else
+ echo "drbd module not loaded"
+ return 1
+ fi
+}
+
+restart() {
+ echo "Restarting all DRBD resources..."
+
+ stop
+ sleep 1
+ start
+}
+
+reload() {
+ $DRBDADM sh-nop
+ echo "Reloading DRBD configuration..."
+ $DRBDADM adjust all
+
+ evaluate_retval
+}
diff --git a/cluster/drbd/init.patch b/cluster/drbd/init.patch
new file mode 100644
index 0000000..003fc01
--- /dev/null
+++ b/cluster/drbd/init.patch
@@ -0,0 +1,11 @@
+--- scripts/Makefile.in.orig 2010-02-26 15:39:16.000000000 +0300
++++ scripts/Makefile.in 2011-01-15 01:59:40.080000128 +0300
+@@ -57,8 +57,6 @@
+
+ install-utils:
+ ifeq ($(WITH_UTILS),yes)
+- install -d $(DESTDIR)$(INITDIR)
+- install -m 755 drbd $(DESTDIR)$(INITDIR)/
+ @ if [ ! -e $(DESTDIR)$(sysconfdir)/drbd.conf ]; then \
+ install -d $(DESTDIR)$(sysconfdir)/; \
+ install -m 644 drbd.conf $(DESTDIR)$(sysconfdir)/; \
diff --git a/cluster/ocfs2-tools/DETAILS b/cluster/ocfs2-tools/DETAILS
index 8cdc0a6..ca2e194 100755
--- a/cluster/ocfs2-tools/DETAILS
+++ b/cluster/ocfs2-tools/DETAILS
@@ -9,12 +9,12 @@ SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
ENTERED=20060711
LICENSE[0]=GPL
KEYWORDS="cluster filesystem"
- SHORT="Tools for OCFS2 cluster filesystem"
+ SHORT="tools for OCFS2 cluster filesystem"
cat << EOF
OCFS2 is a general purpose extent based shared disk cluster file system
with many similarities to ext3. It supports 64 bit inode numbers, and has
automatically extending metadata groups which may also make it attractive
for non-clustered use.
-This spell provides tools for creating, checking, mounting and tuning OCFS2
file-
-systems.
+This spell provides tools for creating, checking, mounting and tuning OCFS2
+file-systems.
EOF
diff --git a/cluster/ocfs2-tools/HISTORY b/cluster/ocfs2-tools/HISTORY
index 0ad9532..2db2e9f 100644
--- a/cluster/ocfs2-tools/HISTORY
+++ b/cluster/ocfs2-tools/HISTORY
@@ -1,3 +1,8 @@
+2011-01-15 Vlad Glagolev <stealth AT sourcemage.org>
+ * init.d/ocfs2{,.conf}: added init script and config (adopted from
+ official vendor-based script in distribution tarball, though without
+ fuser support)
+
2010-12-08 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 1.6.3

diff --git a/cluster/ocfs2-tools/INSTALL b/cluster/ocfs2-tools/INSTALL
new file mode 100755
index 0000000..afe023d
--- /dev/null
+++ b/cluster/ocfs2-tools/INSTALL
@@ -0,0 +1,11 @@
+default_install &&
+
+install -vm 755 -d "$INSTALL_ROOT/etc/ocfs2" &&
+
+if [[ $INIT_INSTALLED ]]; then
+ install_config_file "$SOURCE_DIRECTORY/documentation/samples/cluster.conf"
\
+ "$INSTALL_ROOT/etc/ocfs2/cluster.conf" &&
+
+ install_config_file "$SPELL_DIRECTORY/init.d/ocfs2.conf" \
+ "$INSTALL_ROOT/etc/sysconfig/ocfs2"
+fi
diff --git a/cluster/ocfs2-tools/init.d/ocfs2
b/cluster/ocfs2-tools/init.d/ocfs2
new file mode 100755
index 0000000..ff05e17
--- /dev/null
+++ b/cluster/ocfs2-tools/init.d/ocfs2
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+# Copyright (c) 2005 Oracle
+# All rights reserved.
+#
+# Copyright (c) 2011 Source Mage Team
+# Vlad Glagolev
+
+. /etc/sysconfig/ocfs2
+
+PROGRAM=/bin/false
+RUNLEVEL=3
+NEEDS="+local_fs +network"
+
+. /etc/init.d/smgl_init
+
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+O2CB_CTL="/sbin/o2cb_ctl"
+
+OCFS2_CLUSTER=$( sed -re 's/[[:space:]]+//g' $OCFS2_CONFIG | grep -A4
"cluster:" | grep 'name=' | cut -d= -f2 )
+
+function check_pseudofs() {
+ if [ -z "`$MOUNT -l -t configfs`" ] || [ -z "`$MOUNT -l -t ocfs2_dlmfs`"
]; then
+ echo "One or more pseudo-filesystems required for OCFS2 are not mounted."
+ echo "Make sure you have following lines in your /etc/fstab:"
+ echo "none /config configfs defaults 0 0"
+ echo "none /dlm ocfs2_dlmfs defaults 0 0"
+
+ return 1
+ fi
+}
+
+function ocfs2mounts() {
+ LC_ALL=C awk '$3 == "ocfs2" { print $2 }' /proc/mounts
+}
+
+function ocfs2fstab() {
+ LC_ALL=C awk '!/^#/ && $3 == "ocfs2" && $4 !~ /noauto/ { print $2 }'
/etc/fstab
+}
+
+start() {
+ check_pseudofs || exit 1
+
+ echo "Starting OCFS2 cluster..."
+
+ for cluster in ${OCFS2_CLUSTER}; do
+ $O2CB_CTL -H -n ${cluster} -t cluster -a online=yes >/dev/null 2>&1
+ evaluate_retval
+ done
+}
+
+stop() {
+ echo "Unmounting OCFS2 filesystems..."
+
+ remaining="`ocfs2mounts`"
+ retry=3
+
+ while [ -n "$remaining" -a "$retry" -gt 0 ]; do
+ $UMOUNT -a -t ocfs2 2>/dev/null
+ sleep 1
+
+ remaining="`ocfs2mounts`"
+
+ [ -z "$remaining" ] && break
+
+ retry=$(($retry - 1))
+ done
+
+ if [ ! -z "$remaining" ]; then
+ print_status failure
+ exit 1
+ fi
+
+ echo "Stopping OCFS2 cluster..."
+
+ for cluster in ${OCFS2_CLUSTER}; do
+ $O2CB_CTL -H -n ${cluster} -t cluster -a online=no >/dev/null 2>&1
+ evaluate_retval
+ done
+}
+
+restart() {
+ echo "Restarting OCFS2 cluster..."
+
+ stop
+ sleep 1
+ start
+}
+
+status() {
+ if [ -f /proc/mounts ]; then
+ [ -n "`ocfs2fstab`" ] && echo "Configured OCFS2 mountpoints: "
`ocfs2fstab`
+ [ -n "`ocfs2mounts`" ] && echo "Active OCFS2 mountpoints: " `ocfs2mounts`
+ fi
+}
diff --git a/cluster/ocfs2-tools/init.d/ocfs2.conf
b/cluster/ocfs2-tools/init.d/ocfs2.conf
new file mode 100644
index 0000000..d8210aa
--- /dev/null
+++ b/cluster/ocfs2-tools/init.d/ocfs2.conf
@@ -0,0 +1,3 @@
+# Full path to OCFS2 cluster configuration file
+
+OCFS2_CONFIG="/etc/ocfs2/cluster.conf"




Archive powered by MHonArc 2.6.24.

Top of Page