diff options
author | Amitay Isaacs <amitay@gmail.com> | 2013-02-11 11:25:49 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-02-11 11:25:49 +1100 |
commit | 6e650b6ee56dde18c745f2ad53fc66e00350d285 (patch) | |
tree | d7840ed72b0261563ed2fb965d25461a0c5a2a22 | |
parent | 689384a7b475fb6434ac022267d37414d73ad7b4 (diff) | |
download | samba-6e650b6ee56dde18c745f2ad53fc66e00350d285.tar.gz samba-6e650b6ee56dde18c745f2ad53fc66e00350d285.tar.xz samba-6e650b6ee56dde18c745f2ad53fc66e00350d285.zip |
eventscripts: Remove calls to "smbstatus -np" for samba cleanup
This is an artifact from older versions of Samba. In the newer versions of
Samba, "smbstatus -np" command does not do anything useful, but causes a
traverse in CTDB which is expensive and causes CPU utilization to shoot up.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 053b89c6dbce47001505524606889334559d2ec4)
-rwxr-xr-x | ctdb/config/events.d/50.samba | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index ecbe05e8e7..ccc68647e3 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -68,11 +68,6 @@ service_stop () fi } -# set default samba cleanup period - in minutes -[ -z "$SAMBA_CLEANUP_PERIOD" ] && { - SAMBA_CLEANUP_PERIOD=10 -} - # we keep a cached copy of smb.conf here smbconf_cache="$service_state_dir/smb.conf.cache" @@ -152,15 +147,6 @@ list_samba_shares () ########################### -# periodic cleanup function -periodic_cleanup() { - # running smbstatus scrubs any dead entries from the connections - # and sessionid database - # echo "Running periodic cleanup of samba databases" - smbstatus -np > /dev/null 2>&1 & -} - -########################### ctdb_start_stop_service @@ -170,28 +156,16 @@ ctdb_service_check_reconfigure ########################### -case "$1" in +case "$1" in startup) ctdb_service_start ;; - + shutdown) ctdb_service_stop ;; monitor) - # Create a dummy file to track when we need to do periodic cleanup - # of samba databases - periodic_cleanup_file="$service_state_dir/periodic_cleanup" - [ -f "$periodic_cleanup_file" ] || { - touch "$periodic_cleanup_file" - } - [ `find "$periodic_cleanup_file" -mmin +$SAMBA_CLEANUP_PERIOD | wc -l` -eq 1 ] && { - # Cleanup the databases - periodic_cleanup - touch "$periodic_cleanup_file" - } - if [ "$CTDB_SAMBA_SKIP_SHARE_CHECK" != "yes" ] ; then testparm_background_update @@ -200,7 +174,7 @@ case "$1" in testparm_cat | egrep '^WARNING|^ERROR|^Unknown' && \ die "ERROR: testparm shows smb.conf is not clean" } - + list_samba_shares | ctdb_check_directories_probe || { testparm_foreground_update list_samba_shares | |