diff options
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/config/ctdb.sysconfig | 4 | ||||
-rwxr-xr-x | ctdb/config/events.d/40.vsftpd | 2 | ||||
-rwxr-xr-x | ctdb/config/events.d/50.samba | 40 | ||||
-rwxr-xr-x | ctdb/config/events.d/60.nfs | 2 | ||||
-rw-r--r-- | ctdb/web/samba.html | 18 |
5 files changed, 55 insertions, 11 deletions
diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig index d290321b99..a4dac0afb1 100644 --- a/ctdb/config/ctdb.sysconfig +++ b/ctdb/config/ctdb.sysconfig @@ -33,6 +33,10 @@ # default is to not manage Samba # CTDB_MANAGES_SAMBA=yes +# should ctdb manage starting/stopping Winbind service? +# if left comented out then it will be autodetected based on smb.conf +# CTDB_MANAGES_WINBIND=yes + # you may wish to raise the file descriptor limit for ctdb # use a ulimit command here. ctdb needs one file descriptor per # connected client (ie. one per connected client in Samba) diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events.d/40.vsftpd index d5f8541bb7..bc420fd42d 100755 --- a/ctdb/config/events.d/40.vsftpd +++ b/ctdb/config/events.d/40.vsftpd @@ -42,7 +42,7 @@ case $cmd in ;; monitor) - ctdb_check_tcp_ports "ftp" 20 21 + ctdb_check_tcp_ports "ftp" 21 ;; esac diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index 5f9fa4fafa..bdb351f667 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -16,6 +16,20 @@ shift SAMBA_CLEANUP_PERIOD=10 } + +# autodetect use of winbind if not set in config file +[ -z "$CTDB_MANAGES_WINBIND" ] && { + secmode=`testparm -s --parameter-name=security 2> /dev/null` + case $secmode in + ADS|DOMAIN) + CTDB_MANAGES_WINBIND="yes"; + ;; + *) + CTDB_MANAGES_WINBIND="no"; + ;; + esac +} + ########################### # periodic cleanup function periodic_cleanup() { @@ -32,17 +46,21 @@ case $cmd in # make sure samba is not already started service smb stop > /dev/null 2>&1 - service winbind stop > /dev/null 2>&1 - killall -0 -q smbd winbindd && { - sleep 1 - # make absolutely sure samba is dead - killall -q -9 smbd winbindd + + # restart the winbind service + [ "$CTDB_MANAGES_WINBIND" = "yes" ] && { + service winbind stop > /dev/null 2>&1 + killall -0 -q smbd winbindd && { + sleep 1 + # make absolutely sure samba is dead + killall -q -9 smbd winbindd + } + service winbind start } # start Samba service. Start it reniced, as under very heavy load # the number of smbd processes will mean that it leaves few cycles for # anything else - service winbind start nice service smb start ;; @@ -62,7 +80,11 @@ case $cmd in shutdown) # shutdown Samba when ctdb goes down service smb stop - service winbind stop + + # stop the winbind service + [ "$CTDB_MANAGES_WINBIND" = "yes" ] && { + service winbind stop + } ;; monitor) @@ -89,7 +111,9 @@ case $cmd in ctdb_check_tcp_ports "Samba" $smb_ports # check winbind is OK - ctdb_check_command "winbind" "wbinfo -p" + [ "$CTDB_MANAGES_WINBIND" = "yes" ] && { + ctdb_check_command "winbind" "wbinfo -p" + } ;; esac diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index 6c04f1e303..ed9d6da63b 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -69,7 +69,7 @@ case $cmd in ctdb_check_rpc "NFS" 100003 3 # and that its directories are available - nfs_dirs=`grep -v '^#' < /etc/exports | cut -d' ' -f1` + nfs_dirs=$(grep -v '^#' < /etc/exports | awk {'print $1;'}) ctdb_check_directories "nfs" $nfs_dirs # check that lockd responds to rpc requests diff --git a/ctdb/web/samba.html b/ctdb/web/samba.html index 0b5be7f6bc..b105b1d20a 100644 --- a/ctdb/web/samba.html +++ b/ctdb/web/samba.html @@ -64,7 +64,7 @@ A suitable file can be found in the dbench distribution at http://samba.org/ftp/ <h3>CTDB_MANAGES_SAMBA</h3> This is a parameter in /etc/sysconfig/ctdb<br><br> -When this parameter is set to "yes" CTDB will start/stop/restart the localo samba daemon as the cluster configuration changes.<br><br> +When this parameter is set to "yes" CTDB will start/stop/restart the local samba daemon as the cluster configuration changes.<br><br> When this parameter is set you should also make sure that samba is NOT started by default by the linux system when it boots: <pre> chkconfig samba off @@ -77,5 +77,21 @@ Example: It is strongly recommended that you set this parameter to "yes" if you intend to use clustered samba. +<h3>CTDB_MANAGES_WINBIND</h3> +This is a parameter in /etc/sysconfig/ctdb<br><br> +When this parameter is set to "yes" CTDB will start/stop/restart the local winbind daemon as the cluster configuration changes.<br><br> +When this parameter is set you should also make sure that winbind is NOT started by default by the linux system when it boots: +<pre> + chkconfig winbind off +</pre> + +Example: +<pre> + CTDB_MANAGES_WINBIND="yes" +</pre> + +It is strongly recommended that you set this parameter to "yes" if you +intend to use clustered samba in DOMAIN or ADS security mode. + <!--#include virtual="footer.html" --> |