]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Missing NFS thread count file should just produce warning
authorMartin Schwenke <martin@meltin.net>
Wed, 9 Mar 2016 22:12:33 +0000 (09:12 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 17 Apr 2016 11:54:13 +0000 (13:54 +0200)
This currently causes monitor failure.

Log a warning instead.  If there is a transient issue, such as NFS
being restarted in the background, then the thread count file should
be there the next time around so the count can be adjusted if
necessary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/nfs-linux-kernel-callout

index 9532906f62afdd2368188f8294ab73ee7abaef41..22151a67770826c32b629e722aa340dc4ffc5d68 100755 (executable)
@@ -165,9 +165,13 @@ nfs_check_thread_count ()
     # nfsd should be running the configured number of threads.  If
     # there are a different number of threads then tell nfsd the
     # correct number.
-    read _running_threads <"$_threads_file"
+    read _running_threads <"$_threads_file" || {
+           echo "WARNING: Reading \"${_threads_file}\" unexpectedly failed"
+           exit 0
+    }
+
     # Intentionally not arithmetic comparison - avoids extra errors
-    # when above fails...
+    # when above read fails in an unexpected way...
     if [ "$_running_threads" != "$_configured_threads" ] ; then
        echo "Attempting to correct number of nfsd threads from ${_running_threads} to ${_configured_threads}"
        echo "$_configured_threads" >"$_threads_file"