[SCM] CTDB repository - branch master updated - ctdb-1.10-181-gc7652c4

Michael Adam obnox at samba.org
Tue Apr 5 15:29:57 MDT 2011


The branch, master has been updated
       via  c7652c4038e012b7ef9bc1da352dd2c02d60dc29 (commit)
       via  afb26e38b617b85cdac14a7cd6dd3c85b8fddbc4 (commit)
       via  4137d2a7d31cdce22847cebfc0239cfe2d8e937c (commit)
      from  fb6987c2f747d6dbf9bb3899a480124d1c242a90 (commit)

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


- Log -----------------------------------------------------------------
commit c7652c4038e012b7ef9bc1da352dd2c02d60dc29
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 5 13:58:09 2011 +0200

    packaging: remove the dependency to tdbtool and tdbdump from the spec file
    
    The init script does now check for the availability of tdbdump
    and "tdbtool check" and issues warnings if they are not available.
    This can remove a dependency loop with building samba RPMs.

commit afb26e38b617b85cdac14a7cd6dd3c85b8fddbc4
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 5 13:50:00 2011 +0200

    ctdb.init: print a warning when tdbdump is found but tdbtoo or "tdbtool check" is not available

commit 4137d2a7d31cdce22847cebfc0239cfe2d8e937c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 5 13:43:56 2011 +0200

    ctdb.init: check for availability of "tdbtool check" and "tdbdump"
    
    Print a warning if neither is available.

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

Summary of changes:
 config/ctdb.init           |   40 ++++++++++++++++++++++++++++++++++++++--
 packaging/RPM/ctdb.spec.in |    1 -
 2 files changed, 38 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/ctdb.init b/config/ctdb.init
index 25e158f..1dc051c 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -114,8 +114,6 @@ build_ctdb_options () {
 check_tdb () {
 	local PDBASE=$1
 
-	local TDBTOOL_HAS_CHECK=`echo "help" | /usr/bin/tdbtool | grep check | wc -l`
-
 	test x"$TDBTOOL_HAS_CHECK" = x"1" && {
 		#
 		# Note tdbtool always exits with 0
@@ -146,6 +144,44 @@ check_persistent_databases () {
     test x"$ERRCOUNT" != x"0" && {
 	return 0;
     }
+
+    if test -x /usr/bin/tdbtool ; then
+        HAVE_TDBTOOL=1
+    else
+        HAVE_TDBTOOL=0
+    fi
+
+    if test x"$HAVE_TDBTOOL" = x"1" ; then
+        TDBTOOL_HAS_CHECK=`echo "help" | /usr/bin/tdbtool | grep check | wc -l`
+    else
+        TDBTOOL_HAS_CHECK=0
+    fi
+
+    if test -x /usr/bin/tdbdump ; then
+        HAVE_TDBDUMP=1
+    else
+        HAVE_TDBDUMP=0
+    fi
+
+    if test x"$HAVE_TDBDUMP" = x"0" -a x"$TDBTOOL_HAS_CHECK" = x"0" ; then
+        echo "WARNING: Cannot check persistent databases since"
+        echo "neither 'tdbdump' nor 'tdbtool check' is available."
+        echo "Consider installing tdbtool or at least tdbdump!"
+        return 0
+    fi
+
+    if test x"$HAVE_TDBDUMP" = x"1" -a x"$TDBTOOL_HAS_CHECK" = x"0" ; then
+        if test x"$HAVE_TDBTOOL" = x"0"; then
+            echo "WARNING: 'tdbtool' is not available. Using 'tdbdump' to"
+            echo "check the persistent databases."
+            echo "Consider installing a recent 'tdbtool' for better checks!"
+        else
+            echo "WARNING: The installed 'tdbtool' does not offer the 'check'"
+            echo "subcommand. Using 'tdbdump' for persistent database checks."
+            echo "Consider updating 'tdbtool' for better checks!"
+        fi
+    fi
+
     for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do
 	check_tdb $PDBASE || {
 	    echo "Persistent database $PDBASE is corrupted! CTDB will not start."
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 1f43825..4a0cc32 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -14,7 +14,6 @@ Source: ctdb-%{version}.tar.gz
 
 Prereq: /bin/mktemp /usr/bin/killall
 Prereq: fileutils sed /etc/init.d
-Prereq: /usr/bin/tdbdump /usr/bin/tdbtool
 
 Provides: ctdb = %{version}
 


-- 
CTDB repository


More information about the samba-cvs mailing list