]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Check NFS-Ganesha is running before attempting grace
authorMartin Schwenke <mschwenke@ddn.com>
Fri, 10 May 2024 07:51:18 +0000 (17:51 +1000)
committerVolker Lendecke <vl@samba.org>
Thu, 30 May 2024 11:42:30 +0000 (11:42 +0000)
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 <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/doc/examples/nfs-ganesha-callout

index c09bec6781d5b3f44914fb75f562f7f9bc6a6fc6..b0017d6cc102ade31075e2f8e9452ff4f474107f 100755 (executable)
@@ -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()