From: Martin Schwenke Date: Wed, 1 May 2024 00:22:05 +0000 (+1000) Subject: ctdb-scripts: Remove unused variable NFS_HOSTNAME X-Git-Tag: tdb-1.4.13~1247 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4c7a4f7f0e40079b7e5f13b97e33148ec995376;p=thirdparty%2Fsamba.git ctdb-scripts: Remove unused variable NFS_HOSTNAME 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs b/ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs deleted file mode 100644 index 090d786ea68..00000000000 --- a/ctdb/tests/UNIT/eventscripts/etc/sysconfig/nfs +++ /dev/null @@ -1,2 +0,0 @@ -NFS_HOSTNAME="cluster1" -STATD_HOSTNAME="$NFS_HOSTNAME -H /etc/ctdb/statd-callout " diff --git a/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh b/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh index bd8eb2591ac..868d4ac652c 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/statd-callout.sh @@ -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 < ${_cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${_state} +SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${FAKE_NFS_HOSTNAME}, STATE=${_state} EOF done done | { diff --git a/ctdb/tests/UNIT/eventscripts/stubs/sm-notify b/ctdb/tests/UNIT/eventscripts/stubs/sm-notify index 3825d306463..996f0c7b1a0 100755 --- a/ctdb/tests/UNIT/eventscripts/stubs/sm-notify +++ b/ctdb/tests/UNIT/eventscripts/stubs/sm-notify @@ -71,6 +71,6 @@ sort | while IFS="" read -r file ; do read -r _ _ _ _ _ cip sip <"$file" cat < ${cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${state} +SM_NOTIFY: ${sip} -> ${cip}, MON_NAME=${FAKE_NFS_HOSTNAME}, STATE=${state} EOF done diff --git a/ctdb/tools/statd_callout_helper b/ctdb/tools/statd_callout_helper index 263a4398470..fd734d9ecec 100755 --- a/ctdb/tools/statd_callout_helper +++ b/ctdb/tools/statd_callout_helper @@ -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"