summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-06-18 03:10:50 +1000
committerAndrew Tridgell <tridge@samba.org>2007-06-18 03:10:50 +1000
commit669a6b13f9532af23ab2c5222ec52f3b8009eacb (patch)
tree1e6a23895bd45655ab76e014ebc7b9664d6437c3 /ctdb
parent732353de5fd6f2125438b13e7f0f274bfe916099 (diff)
parentd2ada57f60e207ed6c7f3f8636422e56f894e054 (diff)
downloadsamba-669a6b13f9532af23ab2c5222ec52f3b8009eacb.tar.gz
samba-669a6b13f9532af23ab2c5222ec52f3b8009eacb.tar.xz
samba-669a6b13f9532af23ab2c5222ec52f3b8009eacb.zip
merge from ronnie
(This used to be ctdb commit 7bfc1be6dff5bd5acadfa8a3fd8f00a8ce87ca54)
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/events.d/50.samba13
1 files changed, 13 insertions, 0 deletions
diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba
index 9beac9319a..7005fc8c9b 100755
--- a/ctdb/config/events.d/50.samba
+++ b/ctdb/config/events.d/50.samba
@@ -13,6 +13,9 @@ shift
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 @@ case $cmd in
;;
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