From: Martin Schwenke Date: Wed, 9 Mar 2016 22:12:33 +0000 (+1100) Subject: ctdb-scripts: Missing NFS thread count file should just produce warning X-Git-Tag: talloc-2.1.7~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a658440e13bc5601a77d708d4f3c04ed577bdd5;p=thirdparty%2Fsamba.git ctdb-scripts: Missing NFS thread count file should just produce warning 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 9532906f62a..22151a67770 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -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"