# If the callout wants to use this then it must create it
export CTDB_NFS_CALLOUT_STATE_DIR="${service_state_dir}/callout-state"
+# Export, if set, for use by clustered NFS callouts
+if [ -n "$CTDB_NFS_STATE_FS_TYPE" ] ; then
+ export CTDB_NFS_STATE_FS_TYPE
+fi
+if [ -n "$CTDB_NFS_STATE_MNT" ] ; then
+ export CTDB_NFS_STATE_MNT
+fi
+
nfs_callout_cache="${service_state_dir}/nfs_callout_cache"
nfs_callout_cache_callout="${nfs_callout_cache}/CTDB_NFS_CALLOUT"
nfs_callout_cache_ops="${nfs_callout_cache}/ops"
<variablelist>
- <varlistentry>
- <term>CTDB_CLUSTER_FILESYSTEM_TYPE=gpfs</term>
- <listitem>
- <para>
- The type of cluster filesystem to use with NFS-ganesha.
- Currently only "gpfs" is supported.
- </para>
- <para>
- Default is "gpfs".
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>CTDB_MANAGES_NFS=yes|no</term>
<listitem>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>CTDB_NFS_STATE_FS_TYPE=<parameter>TYPE</parameter></term>
+ <listitem>
+ <para>
+ The type of filesystem used for a clustered NFS' shared
+ state. No default.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>CTDB_NFS_STATE_MNT=<parameter>DIR</parameter></term>
+ <listitem>
+ <para>
+ The directory where a clustered NFS' shared state will be
+ located. No default.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect2>
# Exit on 1st error
set -e
+# Filesystem type and mount point for the (typically clustered)
+# volume that will contain the NFS-Ganesha state.
+state_fs="${CTDB_NFS_STATE_FS_TYPE:-gpfs}"
+state_dir="${CTDB_NFS_STATE_MNT}" # No sane default.
+
# 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}"
ganesha_rec_subdir=${CTDB_GANESHA_REC_SUBDIR:-.ganesha}
procfs=${PROCFS_PATH:-/proc}
-if [ -z "$CTDB_CLUSTER_FILESYSTEM_TYPE" ] ; then
- CTDB_CLUSTER_FILESYSTEM_TYPE="gpfs"
-fi
-
##################################################
# Return 'active' if the shared filesystem is accessible.
get_cluster_fs_state ()
{
- case $CTDB_CLUSTER_FILESYSTEM_TYPE in
+ case $state_fs in
gpfs)
/usr/lpp/mmfs/bin/mmgetstate | awk 'NR == 4 { print $3 }'
;;
*)
- echo "File system $CTDB_CLUSTER_FILESYSTEM_TYPE not supported"
+ echo "File system $state_fs not supported"
exit 1
;;
esac
create_ganesha_recdirs ()
{
- _mounts=$(mount -t $CTDB_CLUSTER_FILESYSTEM_TYPE)
+ _mounts=$(mount -t $state_fs)
if [ -z "$_mounts" ]; then
- echo "startup $CTDB_CLUSTER_FILESYSTEM_TYPE not ready"
+ echo "startup $state_fs not ready"
exit 0
fi
_mntpt=$(echo "$_mounts" | sort | awk 'NR == 1 {print $3}')