2 # script to manage nfs in a clustered environment
7 [ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
12 PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
16 mkdir -p /etc/ctdb/state/nfs
18 # wait for all nfs exported directories to become available
19 nfs_dirs=`grep -v '^#' < /etc/exports | cut -d' ' -f1`
20 ctdb_wait_directories "NFS" $nfs_dirs
22 # make sure nfs is stopped before we start it, or it may get a bind error
23 service nfs stop > /dev/null 2>&1
36 echo $ip >> /etc/ctdb/state/nfs/restart
41 # restart NFS to ensure that all TCP connections to the released ip
43 [ -f /etc/ctdb/state/nfs/restart ] && {
44 ( service nfs status > /dev/null 2>&1 &&
45 service nfs restart > /dev/null 2>&1 ) &
47 /bin/rm -f /etc/ctdb/state/nfs/restart
51 # check that NFS responds to rpc requests
52 ctdb_check_rpc "NFS" 100003 3
53 ctdb_check_rpc "mount" 100005 1
55 # and that its directories are available
56 nfs_dirs=`grep -v '^#' < /etc/exports | cut -d' ' -f1`
57 ctdb_check_directories "nfs" $nfs_dirs