[SCM] CTDB repository - branch master updated - 9043913a54fe707083697f0587c6ffde86ca5a69

Andrew Tridgell tridge at samba.org
Wed Jul 16 02:24:07 GMT 2008


The branch, master has been updated
       via  9043913a54fe707083697f0587c6ffde86ca5a69 (commit)
       via  2fe52c7979ecd28250ec4ac195d3c3999916e573 (commit)
       via  495a6293c284a1e74b9c5e0c112e6ed5feead107 (commit)
      from  c26afe26cc5c1f9cd9eef74166b5fc39dde591d3 (commit)

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


- Log -----------------------------------------------------------------
commit 9043913a54fe707083697f0587c6ffde86ca5a69
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jul 16 12:23:05 2008 +1000

    fixed postun script to prevent corrupting RPM database

commit 2fe52c7979ecd28250ec4ac195d3c3999916e573
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Jul 15 11:03:35 2008 +1000

    Add two new options
    
    CTDB_SAMBA_SKIP_CONF_CHECK and CTDB_SAMBA_CHECK_PORTS.
    The first is used to tell ctdb to no longer monitoring if the smb.conf file is consistent or not.
    
    The second specifies which ports to check that smb is listening on
    instead of using testparm to figure this out.
    
    Since the net, testparm and smbstatus may block indefinitely in some configurations
    we must have a way to configure ctdb to NOT use any of these three commands
    in the scripts. These commands should thus never be used in scripts.
    
    Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>

commit 495a6293c284a1e74b9c5e0c112e6ed5feead107
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Jul 14 11:22:41 2008 +1000

    remove a debugging echo statement

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

Summary of changes:
 config/ctdb.sysconfig    |    7 +++++++
 config/events.d/50.samba |   14 +++++++++-----
 packaging/RPM/ctdb.spec  |    9 ++++++++-
 3 files changed, 24 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/ctdb.sysconfig b/config/ctdb.sysconfig
index 9084f8e..84a90d0 100644
--- a/config/ctdb.sysconfig
+++ b/config/ctdb.sysconfig
@@ -47,6 +47,13 @@
 # since checking each one of them might take a long time.
 # CTDB_SAMBA_SKIP_SHARE_CHECK="yes"
 
+# should we skip checking smb.conf for consistency
+# CTDB_SAMBA_SKIP_CONF_CHECK="yes"
+
+# specify which ports we should check that there is a daemon listening to
+# by default we use testparm and look in smb.conf to figure out.
+# CTDB_SAMBA_CHECK_PORTS="445"
+
 # should ctdb manage starting/stopping Winbind service?
 # if left comented out then it will be autodetected based on smb.conf
 # CTDB_MANAGES_WINBIND=yes
diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index 04ca6e7..9aa21e2 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -108,18 +108,22 @@ case $cmd in
 		touch $CTDB_BASE/state/samba/periodic_cleanup
 	}
 
-	testparm -s 2>&1 | egrep '^WARNING|^ERROR|^Unknown' && {
-	    echo "ERROR: testparm shows smb.conf is not clean"
-	    exit 1
+	[ "$CTDB_SAMBA_SKIP_CONF_CHECK" != "yes" ] && {
+		testparm -s 2>&1 | egrep '^WARNING|^ERROR|^Unknown' && {
+			echo "ERROR: testparm shows smb.conf is not clean"
+			exit 1
+		}
 	}
 
 	[ "$CTDB_SAMBA_SKIP_SHARE_CHECK" != "yes" ] && {
-echo do da test
 		smb_dirs=`testparm -s 2> /dev/null | egrep '^[[:space:]]*path = '  | cut -d= -f2`
 		ctdb_check_directories "Samba" $smb_dirs	
 	}
 
-	smb_ports=`testparm -s --parameter-name="smb ports" 2> /dev/null`
+	smb_ports="$CTDB_SAMBA_CHECK_PORTS"
+	[ -z "$smb_ports" ] && {
+		smb_ports=`testparm -s --parameter-name="smb ports" 2> /dev/null`
+	}
 	ctdb_check_tcp_ports "Samba" $smb_ports
 
 	# check winbind is OK
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index dfe8c39..07ae721 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -78,7 +78,7 @@ exit 0
 
 %postun
 if [ "$1" -ge "1" ]; then
-	%{initdir}/ctdb restart >/dev/null 2>&1
+	%{initdir}/ctdb restart >/dev/null 2>&1 || true
 fi	
 
 
@@ -118,6 +118,13 @@ fi
 %{_includedir}/ctdb_private.h
 
 %changelog
+* Fri Jul 11 2008 : Version 1.0.48-pre
+ - Add two new options :
+   CTDB_SAMBA_SKIP_CONF_CHECK and CTDB_SAMBA_CHECK_PORTS that can be used
+   to override what checks to do when monitoring samba health.
+   We can no longer use the smbstatus, net or testparm commands to check
+   if samba or its config is healthy since these commands may block
+   indefinitely and thus can not be used in scripts.
 * Fri Jul 11 2008 : Version 1.0.47
  - Fix a double free bug where if a user striggered (ctdb eventscript)
    hung and while the timeout handler was being processed a new user


-- 
CTDB repository


More information about the samba-cvs mailing list