1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

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)
This commit is contained in:
Amitay Isaacs 2013-02-11 11:25:49 +11:00
parent 689384a7b4
commit 6e650b6ee5

View File

@ -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"
@ -151,15 +146,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 |