From: Martin Schwenke Date: Fri, 10 May 2024 07:51:18 +0000 (+1000) Subject: ctdb-scripts: Check NFS-Ganesha is running before attempting grace X-Git-Tag: tdb-1.4.11~520 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=911117c79a1c9a61a74aced8d87346dd25c8cce3;p=thirdparty%2Fsamba.git ctdb-scripts: Check NFS-Ganesha is running before attempting grace If monitoring has failed because it isn't running, then don't fail "startipreallocate" or "relaseip" by trying to go into grace. Don't check this for "takeip". In that case NFS-Ganesha had better be running. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout index c09bec6781d..b0017d6cc10 100755 --- a/ctdb/doc/examples/nfs-ganesha-callout +++ b/ctdb/doc/examples/nfs-ganesha-callout @@ -281,9 +281,21 @@ grace_period() fi } +grace_period_if_running() +{ + _arg="$1" + + if ! is_ganesha_running; then + echo "WARNING: NFS Ganesha not running according to PID file" + return 0 + fi + + grace_period "$_arg" +} + nfs_startipreallocate() { - grace_period "0:" + grace_period_if_running "0:" } nfs_releaseip() @@ -291,7 +303,7 @@ nfs_releaseip() _ip="$2" # NFS-Ganesha recovery code only processes items matching $_ip - grace_period "2:${_ip}" + grace_period_if_running "2:${_ip}" } nfs_takeip()