[SCM] CTDB repository - branch master updated - 2fe52c7979ecd28250ec4ac195d3c3999916e573

Ronnie Sahlberg sahlberg at samba.org
Tue Jul 15 01:11:48 GMT 2008


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

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


- Log -----------------------------------------------------------------
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>

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

Summary of changes:
 config/ctdb.sysconfig    |    7 +++++++
 config/events.d/50.samba |   13 +++++++++----
 packaging/RPM/ctdb.spec  |    7 +++++++
 3 files changed, 23 insertions(+), 4 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 a8aad91..9aa21e2 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -108,9 +108,11 @@ 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" ] && {
@@ -118,7 +120,10 @@ case $cmd in
 		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..7182f7d 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -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