1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

ctdb-doc: Factor out grace period function

Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Vinit Agnihotri 2023-10-26 23:03:01 -07:00 committed by Volker Lendecke
parent 9631e3569d
commit 34c76ffec5

View File

@ -254,31 +254,38 @@ service_check ()
#-------------------------------------------------
nfs_releaseip ()
grace_period()
{
_arg="$1"
if [ -x "/usr/bin/grace_period" ]; then
/usr/bin/grace_period "2:${2}"
/usr/bin/grace_period "$_arg"
else
dbus-send --print-reply --system --dest=org.ganesha.nfsd \
/org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace \
string:"2:${2}"
string:"$_arg"
fi
}
nfs_releaseip()
{
_ip="$2"
# NFS-Ganesha recovery code only processes items matching $_ip
grace_period "2:${_ip}"
}
nfs_takeip ()
{
_ip="$2"
case $state_fs in
glusterfs)
check_ln "$NODESTATEDIR" "${GANSTATEDIR}/${2}"
check_ln "$NODESTATEDIR" "${GANSTATEDIR}/${_ip}"
;;
esac
if [ -x "/usr/bin/grace_period" ]; then
/usr/bin/grace_period "5:${2}"
else
dbus-send --print-reply --system --dest=org.ganesha.nfsd \
/org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace \
string:"5:${2}"
fi
grace_period "5:${_ip}"
}
##################################################