Rev 424: added nfs event script in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Fri Jun 1 14:10:23 GMT 2007


------------------------------------------------------------
revno: 424
revision-id: tridge at samba.org-20070601141022-6r6bw0fas6x14vzn
parent: tridge at samba.org-20070601133301-rtnxemka2ry7cw4e
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-06-02 00:10:22 +1000
message:
  added nfs event script
added:
  tools/events.d/nfs             nfs-20070601141008-hy3h4qgbk1jd2jci-1
modified:
  tools/events.d/samba           samba-20070601105340-vlcvnp6euoj3zdwy-3
=== added file 'tools/events.d/nfs'
--- a/tools/events.d/nfs	1970-01-01 00:00:00 +0000
+++ b/tools/events.d/nfs	2007-06-01 14:10:22 +0000
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script to manage nfs in a clustered environment
+
+. /etc/sysconfig/ctdb
+. /etc/ctdb/functions
+
+cmd="$1"
+shift
+
+case $cmd in 
+     startup)
+	mkdir -p /etc/ctdb/state/nfs
+	;;
+
+     releaseip)
+	iface=$1
+	ip=$2
+	maskbits=$3
+
+	echo $ip >> /etc/ctdb/state/nfs/restart
+	exit 0
+	;;
+
+     recovered)
+        # restart NFS to ensure that all TCP connections to the released ip
+	# are closed
+	[ -f /etc/ctdb/state/nfs/restart ] && {
+		( /sbin/service nfs status > /dev/null 2>&1 && 
+                      /sbin/service nfs restart > /dev/null 2>&1 ) &
+	} > /dev/null 2>&1
+	/bin/rm -f /etc/ctdb/state/nfs/restart
+	;;
+
+esac
+
+exit 0

=== modified file 'tools/events.d/samba'
--- a/tools/events.d/samba	2007-06-01 13:25:33 +0000
+++ b/tools/events.d/samba	2007-06-01 14:10:22 +0000
@@ -34,9 +34,8 @@
 	;;
 
      shutdown)
-	# shutdown Samba cleanly when ctdb goes down
-	/etc/init.d/smb stop
-	/etc/init.d/winbind stop
+	# shutdown Samba when ctdb goes down
+	killall -q smbd nmbd winbindd
 	;;
 esac
 



More information about the samba-cvs mailing list