mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
add helpers to stop/start nfs lockmanager on different platforms
(This used to be ctdb commit 3b797d851bd4bdb8ec2b3981061c668d2cf0f97c)
This commit is contained in:
parent
0e31eaed57
commit
42702fa770
@ -268,3 +268,45 @@ startstop_nfs() {
|
||||
;;
|
||||
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
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ case "$1" in
|
||||
# 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
|
||||
@ -96,7 +96,7 @@ case "$1" in
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user