From 911117c79a1c9a61a74aced8d87346dd25c8cce3 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 10 May 2024 17:51:18 +1000 Subject: [PATCH] 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 --- ctdb/doc/examples/nfs-ganesha-callout | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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() -- 2.47.3