The branch, 1.2 has been updated via 2af29fa1007ca32713f382d950f29bd81e2b7f07 (commit) via 21d7b9f19c2915f453af5af3c54322694c95c0fb (commit) via 271b94b273570398a7ddee4ec195fdfd4a580f08 (commit) from afdde23217250775f078f5d95912e76a3b2962eb (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2 - Log ----------------------------------------------------------------- commit 2af29fa1007ca32713f382d950f29bd81e2b7f07 Author: Michael Adam <ob...@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 21d7b9f19c2915f453af5af3c54322694c95c0fb Author: Michael Adam <ob...@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 271b94b273570398a7ddee4ec195fdfd4a580f08 Author: Michael Adam <ob...@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 00cead2..55c1fe3 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