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@gmail.com>
# 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
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" ] && {
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
%{_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