PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
+
+
case $cmd in
startup)
/bin/mkdir -p $CTDB_BASE/state/nfs
/bin/rm -f $CTDB_BASE/state/statd/statd.restart >/dev/null 2>/dev/null
# make sure nfs is stopped before we start it, or it may get a bind error
- service nfs stop > /dev/null 2>&1
- service nfslock stop > /dev/null 2>&1
-
- service nfslock start
- service nfs start
+ startstop_nfs stop
+ startstop_nfs start
;;
shutdown)
- # shutting down nfs can take a while so put it in the background
- service nfs stop &
- service nfslock stop &
+ startstop_nfs stop
exit 0
;;
echo "killed $_killcount TCP connections to released IP $_IP"
}
+########################################################
+# start/stop the nfs service on different platforms
+########################################################
+startstop_nfs() {
+ PLATFORM="unknown"
+ [ -x /etc/init.d/nfsserver ] && {
+ PLATFORM="sles"
+ }
+ [ -x /etc/init.d/nfslock ] && {
+ PLATFORM="rhel"
+ }
+
+ case $PLATFORM in
+ sles)
+ case $1 in
+ start)
+ service nfsserver start
+ ;;
+ stop)
+ service nfsserver stop > /dev/null 2>&1
+ ;;
+ esac
+ ;;
+ rhel)
+ case $1 in
+ start)
+ service nfslock start
+ service nfs start
+ ;;
+ stop)
+ service nfs stop > /dev/null 2>&1
+ service nfslock stop > /dev/null 2>&1
+ ;;
+ esac
+ ;;
+ *)
+ echo "Unknown platform. NFS is not supported with ctdb"
+ exit 1
+ ;;
+ esac
+}