;;
esac
}
+
+########################################################
+# start/stop the nfs lockmanager service on different platforms
+########################################################
+startstop_nfslock() {
+ PLATFORM="unknown"
+ [ -x /etc/init.d/nfsserver ] && {
+ PLATFORM="sles"
+ }
+ [ -x /etc/init.d/nfslock ] && {
+ PLATFORM="rhel"
+ }
+
+ case $PLATFORM in
+ sles)
+ # for sles there is no service for lockmanager
+ # so we instead just shutdown/restart nfs
+ case $1 in
+ start)
+ service nfsserver start
+ ;;
+ stop)
+ service nfsserver stop > /dev/null 2>&1
+ ;;
+ esac
+ ;;
+ rhel)
+ case $1 in
+ start)
+ service nfslock start
+ ;;
+ stop)
+ service nfslock stop > /dev/null 2>&1
+ ;;
+ esac
+ ;;
+ *)
+ echo "Unknown platform. NFS locking is not supported with ctdb"
+ exit 1
+ ;;
+ esac
+}
# will respond "strangely" immediately after restarting it, which
# causes clients to fail to reclaim the locks.
#
- service nfslock stop > /dev/null 2>&1
+ startstop_nfslock stop > /dev/null 2>&1
sleep 2
# copy all monitored clients on this node to the local lockmanager
done
# now start lockmanager again with the new state directory.
- service nfslock start > /dev/null 2>&1
+ startstop_nfslock start > /dev/null 2>&1
# we now need to send out additional statd notifications to ensure
# that clients understand that the lockmanager has restarted.