Skip to content

Commit

Permalink
ctdb-scripts: Check NFS-Ganesha is running before attempting grace
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
  • Loading branch information
mschwenke-ddn authored and vlendec committed May 30, 2024
1 parent 27c5388 commit 911117c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ctdb/doc/examples/nfs-ganesha-callout
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,29 @@ 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()
{
_ip="$2"

# NFS-Ganesha recovery code only processes items matching $_ip
grace_period "2:${_ip}"
grace_period_if_running "2:${_ip}"
}

nfs_takeip()
Expand Down

0 comments on commit 911117c

Please sign in to comment.