1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

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 <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2024-05-01 10:22:05 +10:00 committed by Martin Schwenke
parent ece6153038
commit b4c7a4f7f0
4 changed files with 4 additions and 23 deletions

View File

@ -1,2 +0,0 @@
NFS_HOSTNAME="cluster1"
STATD_HOSTNAME="$NFS_HOSTNAME -H /etc/ctdb/statd-callout "

View 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 | {

View File

@ -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

View File

@ -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"