From 8de0a339b550e7363d265af04ad69f2179af75c6 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 20 Mar 2019 16:11:32 +1100 Subject: [PATCH] ctdb-scripts: Factor out nfs_load_config() BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/config/nfs-linux-kernel-callout | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index bd534c41a32..ca7e2b88e96 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -64,6 +64,16 @@ EOF exit 1 } +################################################## + +nfs_load_config () +{ + _config="${1:-${nfs_config}}" + + if [ -r "$_config" ] ; then + . "$_config" + fi +} ################################################## # Basic service stop and start @@ -167,9 +177,7 @@ nfs_startup () nfs_check_thread_count () { # Load NFS configuration to get desired number of threads. - if [ -r "$nfs_config" ] ; then - . "$nfs_config" - fi + nfs_load_config # If $RPCNFSDCOUNT/$USE_KERNEL_NFSD_NUMBER isn't set then we could # guess the default from the initscript. However, let's just