Rev 547: merge from ronnie in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Sun Jun 17 17:10:50 GMT 2007


------------------------------------------------------------
revno: 547
revision-id: tridge at samba.org-20070617171050-2zkpq4tu68qqryfo
parent: tridge at samba.org-20070617133144-nympluy3k8uuqbf5
parent: sahlberg at ronnie-20070617163429-lkw74mopo7vg3l7l
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Mon 2007-06-18 03:10:50 +1000
message:
  merge from ronnie
modified:
  config/events.d/50.samba       samba-20070601105340-vlcvnp6euoj3zdwy-3
    ------------------------------------------------------------
    revno: 432.1.80
    merged: sahlberg at ronnie-20070617163429-lkw74mopo7vg3l7l
    parent: sahlberg at ronnie-20070617011342-z2cukqaalg61vyrt
    committer: Ronnie Sahlberg <sahlberg at ronnie>
    branch nick: ctdb
    timestamp: Mon 2007-06-18 02:34:29 +1000
    message:
      add a mechanism to the samba event script to do periodic cleanup of the 
      databases once every 60 minutes
=== modified file 'config/events.d/50.samba'
--- a/config/events.d/50.samba	2007-06-17 02:05:29 +0000
+++ b/config/events.d/50.samba	2007-06-17 17:10:50 +0000
@@ -13,6 +13,9 @@
 
 case $cmd in 
      startup)
+	# create the state directory for samba
+	/bin/mkdir -p /etc/ctdb/state/samba
+
 	# wait for all shared directories to become available
 	smb_dirs=`testparm -s 2> /dev/null | egrep '^\s*path = '  | cut -d= -f2`
 	ctdb_wait_directories "Samba" $smb_dirs	
@@ -55,6 +58,16 @@
 	;;
 
      monitor)
+	# Create a dummy file to track when we need to do periodic cleanup
+	# of samba databases
+	[ -f /etc/ctdb/state/samba/periodic_cleanup ] || {
+		touch /etc/ctdb/state/samba/periodic_cleanup
+	}
+	[ `/usr/bin/find /etc/ctdb/state/samba/periodic_cleanup -mmin +1 | wc -l` -eq 1 ] && {
+		# Cleanup the databases
+		touch /etc/ctdb/state/samba/periodic_cleanup
+	}
+
 	testparm -s 2>&1 | egrep '^WARNING|^ERROR|^Unknown' && {
 	    echo "`date` ERROR: testparm shows smb.conf is not clean"
 	    exit 1



More information about the samba-cvs mailing list