1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/ctdb/config/events.d/60.nfs
Andrew Tridgell bd81cc521d ignore commented out entries in /etc/exports
(This used to be ctdb commit d316b49ba46e819359f045adfd87da92860fd1b5)
2007-06-04 23:54:22 +10:00

49 lines
869 B
Bash
Executable File

#!/bin/sh
# script to manage nfs in a clustered environment
. /etc/ctdb/functions
loadconfig nfs
[ "$CTDB_MANAGES_NFS" = "yes" ] || exit 0
cmd="$1"
shift
case $cmd in
startup)
mkdir -p /etc/ctdb/state/nfs
# wait for all nfs exported directories to become available
nfs_dirs=`grep -v '^#' < /etc/exports | cut -d' ' -f1`
ctdb_wait_directories "NFS" $nfs_dirs
service nfs start
;;
shutdown)
service nfs stop
;;
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 ] && {
( service nfs status > /dev/null 2>&1 &&
service nfs restart > /dev/null 2>&1 ) &
} > /dev/null 2>&1
/bin/rm -f /etc/ctdb/state/nfs/restart
;;
esac
exit 0