[SCM] CTDB repository - branch master updated - ctdb-1.0.60-7-g0098efd

Ronnie Sahlberg sahlberg at samba.org
Thu Oct 16 02:29:36 GMT 2008


The branch, master has been updated
       via  0098efd4443038f2d902e3a7c3640e63f06be7d1 (commit)
       via  3b8d49bf58f4145cdca08565f06cd43fd36991e1 (commit)
       via  f9779d3a237db59d7fdad92185ac7e42715466e6 (commit)
      from  6fb2f8a36239e5902e27cf10213f85faf216d6f1 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0098efd4443038f2d902e3a7c3640e63f06be7d1
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 15 16:40:44 2008 +1100

    new version 1.0.61

commit 3b8d49bf58f4145cdca08565f06cd43fd36991e1
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 15 16:29:09 2008 +1100

    install the new multipath monitoring event script

commit f9779d3a237db59d7fdad92185ac7e42715466e6
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 15 16:27:33 2008 +1100

    add an eventscript to monitor that the multipath devices are healthy

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                   |    1 +
 config/events.d/20.multipathd |   99 +++++++++++++++++++++++++++++++++++++++++
 packaging/RPM/ctdb.spec       |    8 +++-
 3 files changed, 107 insertions(+), 1 deletions(-)
 create mode 100644 config/events.d/20.multipathd


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 98ab197..779bd8b 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -189,6 +189,7 @@ install: all
 	${INSTALLCMD} -m 644 config/events.d/README $(DESTDIR)/$(docdir)/ctdb/README.eventscripts
 	${INSTALLCMD} -m 755 config/events.d/00.ctdb $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 config/events.d/10.interface $(DESTDIR)$(etcdir)/ctdb/events.d
+	${INSTALLCMD} -m 755 config/events.d/20.multipathd $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 config/events.d/40.vsftpd $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 config/events.d/41.httpd $(DESTDIR)$(etcdir)/ctdb/events.d
 	${INSTALLCMD} -m 755 config/events.d/50.samba $(DESTDIR)$(etcdir)/ctdb/events.d
diff --git a/config/events.d/20.multipathd b/config/events.d/20.multipathd
new file mode 100644
index 0000000..93a58ab
--- /dev/null
+++ b/config/events.d/20.multipathd
@@ -0,0 +1,99 @@
+#!/bin/sh
+# ctdb event script for monitoring the multipath daemon
+#
+# Configure monitporing of multipath devices by listing the device serials
+# in /etc/ctdb/multipathd :
+#   CTDB_MONITOR_MPDEVICES="device1 device2 ..."
+#
+
+PATH=/bin:/usr/bin:$PATH
+
+. $CTDB_BASE/functions
+loadconfig ctdb
+loadconfig multipathd
+
+cmd="$1"
+shift
+
+[ -z "$CTDB_MONITOR_MPDEVICES" ] && {
+	exit 0
+}
+
+MPFAILURE=$CTDB_BASE/state/multipathd/failure
+
+multipathd_check_background()
+{
+	for DEVICE in $CTDB_MONITOR_MPDEVICES; do
+		# check that we can see all devices
+		if [ -z "`multipath -ll $DEVICE`" ]; then
+			echo Device $DEVICE not known to multipathd
+			exit 1
+		fi
+
+		# check that all devices are active
+		if [ -z "`multipath -ll $DEVICE|grep prio|grep active`" ]; then
+			echo Device $DEVICE has no active paths
+			exit 1
+		fi
+	done
+	exit 0
+}
+
+multipathd_check()
+{
+	# run the actual check in the background since the call to 
+	# multipath may block.
+	(
+	multipathd_check_background &
+	pid="$!"
+	timeleft=10
+
+	while [ $timeleft -gt 0 ]; do
+		timeleft=$(($timeleft - 1))
+
+		# see if the process still exists
+		kill -0 $pid > /dev/null 2>&1 || {
+			# it doesn't exist, grab its exit status
+			wait $pid
+			[ $? = 0 ] || {
+				echo "20.multipathd: multipath background update exited with status $?"
+				touch $MPFAILURE
+				exit 1
+			}
+			rm $MPFAILURE 2>/dev/null
+			exit 0
+		}
+		sleep 1
+	done
+	echo "20.multipathd: Callout to multipath checks hung."
+	touch $MPFAILURE
+	exit 1
+	) &
+
+	if [ -f $MPFAILURE ]; then
+		return 1
+	else
+		return 0
+	fi
+}
+
+case $cmd in
+     startup)
+	# create a state directory to keep/track the multipath device
+	# state
+	/bin/mkdir -p $CTDB_BASE/state/multipathd
+	exit 0
+	;;
+
+     monitor)
+	multipathd_check
+	[ "$?" == "0" ] || {
+		echo 20.multipathd: monitoring of multipathing failed
+		exit 1
+	}
+	exit 0
+	;;
+esac
+
+# ignore unknown commands
+exit 0
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index a9807e0..73905c0 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0
-Release: 60
+Release: 61
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -96,6 +96,7 @@ fi
 %{_docdir}/ctdb/README.eventscripts
 %{_sysconfdir}/ctdb/events.d/00.ctdb
 %{_sysconfdir}/ctdb/events.d/10.interface
+%{_sysconfdir}/ctdb/events.d/20.multipathd
 %{_sysconfdir}/ctdb/events.d/40.vsftpd
 %{_sysconfdir}/ctdb/events.d/41.httpd
 %{_sysconfdir}/ctdb/events.d/50.samba
@@ -119,6 +120,11 @@ fi
 %{_includedir}/ctdb_private.h
 
 %changelog
+* Wed Oct 15 2008 : Version 1.0.61
+ - Use "route add -net" instead of "ip route add" when adding routes in 99.routing
+ - lower the loglevel os several debug statements
+ - check the status returned from ctdb_ctrl_get_tickles() before we try to print them out to the screen.
+ - install a new eventscript 20.multipathd whoich can be used to monitor that multipath devices are healthy
 * Wed Oct 15 2008 : Version 1.0.60
  - Verify that nodes we try to ban/unban are reachable and print an error othervise.
  - Update the client and server sides of TAKEIP/RELEASEIP/GETPUBLICIPS and GETNODEMAP to fall back to the old style ipv4-only controls if the new ipv4/ipv6 controls fail. This allows an ipv4/v6 enabled ctdb daemon to interoperate with earlier ipv4-only versions of the daemons.


-- 
CTDB repository


More information about the samba-cvs mailing list