From 944d9d308d53598ba0aa2dc599fc1f5c78e78313 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 27 Mar 2024 14:24:09 +1100 Subject: [PATCH] ctdb-scripts: Add script option CTDB_NFS_EXPORTS_FILE Exports may be contained in an include file rather than the top-level ganesha.conf. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- ctdb/config/functions | 3 +++ ctdb/config/nfs-linux-kernel-callout | 9 +++------ ctdb/doc/ctdb-script.options.5.xml | 23 +++++++++++++++++++++++ ctdb/doc/examples/nfs-ganesha-callout | 4 +++- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/ctdb/config/functions b/ctdb/config/functions index 2582e5b07b7..fbb1e284020 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -1125,6 +1125,9 @@ nfs_callout_init() if [ -n "$CTDB_NFS_STATE_MNT" ]; then export CTDB_NFS_STATE_MNT fi + if [ -n "$CTDB_NFS_EXPORTS_FILE" ]; then + export CTDB_NFS_EXPORTS_FILE + fi nfs_callout_cache="${_state_dir}/nfs_callout_cache" nfs_callout_cache_callout="${nfs_callout_cache}/CTDB_NFS_CALLOUT" diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 0d427b6d828..cbc0482d73f 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -6,14 +6,11 @@ set -e # NFS exports file. Some code below keeps a cache of output derived # from exportfs(8). When this file is updated the cache is invalid # and needs to be regenerated. -# -# To change the file, edit the default value below. Do not set -# CTDB_NFS_EXPORTS_FILE - it isn't a configuration variable, just a -# hook for testing. nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/var/lib/nfs/etab}" -# As above, edit the default value below. CTDB_NFS_DISTRO_STYLE is a -# test variable only. +# Do not set CTDB_NFS_DISTRO_STYLE - it isn't a configuration +# variable, just a hook for testing. To change the style, edit the +# default value below. nfs_distro_style="${CTDB_NFS_DISTRO_STYLE:-systemd-redhat}" # As above, edit the default value below. CTDB_SYS_ETCDIR is a diff --git a/ctdb/doc/ctdb-script.options.5.xml b/ctdb/doc/ctdb-script.options.5.xml index ffe4c3abd62..4f473b8b970 100644 --- a/ctdb/doc/ctdb-script.options.5.xml +++ b/ctdb/doc/ctdb-script.options.5.xml @@ -862,6 +862,29 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000 + + + CTDB_NFS_EXPORTS_FILE=FILE + + + + Set FILE as the path of the file containing NFS exports, + for use by the NFS callout (see CTDB_NFS_CALLOUT, + above). This is used for share checks when + CTDB_NFS_SKIP_SHARE_CHECK is not set to "yes". This is + most useful with NFS-Ganesha, since it supports + configuration include files and exports may be stored in + a separate file. + + + Default is /var/lib/nfs/etab for + nfs-linux-kernel-callout, + /etc/ganesha/ganesha.conf for + nfs-ganesha-callout. + + + + CTDB_NFS_SKIP_SHARE_CHECK=yes|no diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout index 074ec73bc44..64f57506d9f 100755 --- a/ctdb/doc/examples/nfs-ganesha-callout +++ b/ctdb/doc/examples/nfs-ganesha-callout @@ -41,9 +41,11 @@ set -e state_fs="${CTDB_NFS_STATE_FS_TYPE:-gpfs}" state_dir="${CTDB_NFS_STATE_MNT}" # No sane default. +# Location of exports file +nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/etc/ganesha/ganesha.conf}" + # To change the following, edit the default values below. Do not set # these - they aren't configuration variables, just hooks for testing. -nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/etc/ganesha/ganesha.conf}" nfs_service="${CTDB_NFS_SERVICE:-nfs-ganesha}" ganesha_rec_subdir=${CTDB_GANESHA_REC_SUBDIR:-.ganesha} procfs=${PROCFS_PATH:-/proc} -- 2.47.3