ctdb-scripts: Add script option CTDB_NFS_EXPORTS_FILE
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 27 Mar 2024 03:24:09 +0000 (14:24 +1100)
committerMartin Schwenke <mschwenke@ddn.com>
Tue, 21 May 2024 23:15:18 +0000 (09:15 +1000)
Exports may be contained in an include file rather than the top-level
ganesha.conf.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
ctdb/config/functions
ctdb/config/nfs-linux-kernel-callout
ctdb/doc/ctdb-script.options.5.xml
ctdb/doc/examples/nfs-ganesha-callout

index e76082b7cb333c0f0e8d285d0d2831a50828ea37..3fa24a542c97e4477fb2404e7c87ac4b8203e91e 100755 (executable)
@@ -1072,6 +1072,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"
index 0d427b6d82854e60077dbb5430e5a4e88b081b4a..cbc0482d73fe7f38de4451ee922ebbfc8e75a09d 100755 (executable)
@@ -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
index ffe4c3abd62ed92aca94cecdbd516206e14e24f2..4f473b8b970a005f80093301282e281075c493b9 100644 (file)
@@ -862,6 +862,29 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
          </listitem>
        </varlistentry>
 
+       <varlistentry>
+         <term>
+           CTDB_NFS_EXPORTS_FILE=<parameter>FILE</parameter>
+         </term>
+         <listitem>
+           <para>
+             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.
+           </para>
+           <para>
+             Default is <filename>/var/lib/nfs/etab</filename> for
+             <filename>nfs-linux-kernel-callout</filename>,
+             <filename>/etc/ganesha/ganesha.conf</filename> for
+             <filename>nfs-ganesha-callout</filename>.
+           </para>
+         </listitem>
+       </varlistentry>
+
        <varlistentry>
          <term>
            CTDB_NFS_SKIP_SHARE_CHECK=yes|no
index 074ec73bc446c29cd5ec2d3457c5975143aa2c68..64f57506d9f821e6fb3e452f550d2fc4e8c57ccc 100755 (executable)
@@ -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}