diff options
author | Martin Schwenke <martin@meltin.net> | 2020-07-20 12:02:45 +1000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2020-08-10 09:25:17 +0000 |
commit | 18628ba15585f991b004ef4bd66abf2f8ed12b3f (patch) | |
tree | 5a0b79015ef6c9988391fdacff17f7b063d482b3 | |
parent | 8bd4e0187803b4263dae9eafb07d539350f30ce0 (diff) | |
download | samba-18628ba15585f991b004ef4bd66abf2f8ed12b3f.tar.gz |
ctdb-scripts: Use nfsconf as a last resort get nfsd thread count
If nfsconf exists then use it as last resort to attempt to extract
[nfsd]:threads from /etc/nfs.conf.
Invocation of nfsconf requires "|| true" because this script uses "set
-e". Add a stub that always fails to at least test this much.
RN: Use nfsconf utility for variable values in CTDB NFS scripts
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14444
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jul 27 07:06:58 UTC 2020 on sn-devel-184
(cherry picked from commit 642dc6ded6426ba2fbf3ac1e5cd71aae11ca245b)
-rwxr-xr-x | ctdb/config/nfs-linux-kernel-callout | 3 | ||||
-rwxr-xr-x | ctdb/tests/UNIT/eventscripts/stubs/nfsconf | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 71d8ecf8074..6a372d4b4fd 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -299,6 +299,9 @@ nfs_check_thread_count () # assume that those using the default don't care about the number # of threads and that they have switched on this feature in error. _configured_threads="${RPCNFSDCOUNT:-${USE_KERNEL_NFSD_NUMBER}}" + if [ -z "$_configured_threads" ] && type nfsconf >/dev/null 2>&1 ; then + _configured_threads=$(nfsconf --get nfsd threads) || true + fi [ -n "$_configured_threads" ] || return 0 _threads_file="${PROCFS_PATH}/fs/nfsd/threads" diff --git a/ctdb/tests/UNIT/eventscripts/stubs/nfsconf b/ctdb/tests/UNIT/eventscripts/stubs/nfsconf new file mode 100755 index 00000000000..84dd9ea5f60 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/stubs/nfsconf @@ -0,0 +1,5 @@ +#!/bin/sh + +# This always fails for now, since there are no tests that expect to +# use it. +exit 1 |