]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Remove unused variable NFS_HOSTNAME
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 1 May 2024 00:22:05 +0000 (10:22 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 29 Aug 2024 22:48:33 +0000 (22:48 +0000)
This was passed to CTDB's old smnotify.  This has been replaced by use
of nfs-utils' sm-notify, which doesn't need this.

In test, a fake NFS_HOSTNAME is still needed.  Real sm-notify will get
it from a reverse host lookup of the IP address.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs [deleted file]
ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh
ctdb/tests/UNIT/eventscripts/stubs/sm-notify
ctdb/tools/statd_callout_helper

diff --git a/ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs b/ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs
deleted file mode 100644 (file)
index 090d786..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-NFS_HOSTNAME="cluster1"
-STATD_HOSTNAME="$NFS_HOSTNAME -H /etc/ctdb/statd-callout "
index bd8eb2591ac0d760b054934a4fe4dbc2a4e90c19..868d4ac652c820138563eed3ae00a3bfec4225f1 100644 (file)
@@ -4,7 +4,7 @@ setup()
        ctdb_set_pnn
        setup_date "1234567890"
 
-       export NFS_HOSTNAME
+       export FAKE_NFS_HOSTNAME="cluster1"
 }
 
 ctdb_catdb_format_pairs()
@@ -64,7 +64,7 @@ check_statd_callout_smnotify()
                while read -r _ _sip _; do
                        for _cip; do
                                cat <<EOF
-SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${_state}
+SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${FAKE_NFS_HOSTNAME}, STATE=${_state}
 EOF
                        done
                done | {
index 3825d30646391961cdd265633784966528872944..996f0c7b1a0a12965ea24bc1a17001fe6a92f0a5 100755 (executable)
@@ -71,6 +71,6 @@ sort |
 while IFS="" read -r file ; do
        read -r _ _ _ _ _ cip sip <"$file"
        cat <<EOF
-SM_NOTIFY: ${sip} -> ${cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${state}
+SM_NOTIFY: ${sip} -> ${cip}, MON_NAME=${FAKE_NFS_HOSTNAME}, STATE=${state}
 EOF
 done
index 263a439847051c3ae4f18589ba8d12235761bd1c..fd734d9ecece19c092d7dd5ee071e8a34ff1fcbf 100755 (executable)
@@ -11,8 +11,7 @@
 # Older Linux versions may use something like the following...
 #
 # /etc/sysconfig/nfs (Red Hat) or /etc/default/nfs-common (Debian):
-#   NFS_HOSTNAME=mycluster
-#   STATD_HOSTNAME="${NFS_HOSTNAME} -H /usr/local/libexec/ctdb/statd_callout"
+#   STATD_HOSTNAME="mycluster -H /usr/local/libexec/ctdb/statd_callout"
 #
 # If using Linux kernel NFS then the following should also be set in
 # /etc/nfs.conf:
@@ -38,22 +37,6 @@ die()
        exit 1
 }
 
-# Try different variables to find config file for NFS_HOSTNAME
-load_system_config "nfs" "nfs-common"
-
-# If NFS_HOSTNAME not set then try to pull it out of /etc/nfs.conf
-if [ -z "$NFS_HOSTNAME" ]; then
-       if type nfsconf >/dev/null 2>&1; then
-               NFS_HOSTNAME=$(nfsconf --get statd name)
-       elif type git >/dev/null 2>&1; then
-               # git to the rescue!
-               NFS_HOSTNAME=$(git config --file=/etc/nfs.conf statd.name)
-       fi
-fi
-
-[ -n "$NFS_HOSTNAME" ] ||
-       die "NFS_HOSTNAME is not configured. statd_callout_helper failed"
-
 ############################################################
 
 ctdb_setup_state_dir "service" "nfs"