From 14c40e9be4842a9191688b45ab05513255660abe Mon Sep 17 00:00:00 2001 From: Sepideh Roghanchi Date: Wed, 13 Nov 2024 13:52:34 -0800 Subject: [PATCH] Centos7 --- packaging/aznfs/RPM/aznfs.spec | 2 +- scripts/aznfs_install.sh | 2 +- src/nfsv4mountscript.sh | 39 ---------------------------------- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/packaging/aznfs/RPM/aznfs.spec b/packaging/aznfs/RPM/aznfs.spec index a37dcd3a..bde8bafe 100644 --- a/packaging/aznfs/RPM/aznfs.spec +++ b/packaging/aznfs/RPM/aznfs.spec @@ -37,7 +37,7 @@ if [ "$init" != "systemd" ]; then exit 1 fi -# Stunnel package is missing in Mariner package repo, and default stunnel package version on RedHat 7 is not compatible with aznfs. +# Stunnel package is missing in Mariner package repo, and default stunnel package version on RedHat7 and Centos7 is not compatible with aznfs. if grep -qi "mariner" /etc/os-release || [[ "$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d'.' -f1)" -eq 7 ]]; then # Check if stunnel is not already installed. if ! command -v stunnel > /dev/null; then diff --git a/scripts/aznfs_install.sh b/scripts/aznfs_install.sh index af1143ff..8bf3d225 100644 --- a/scripts/aznfs_install.sh +++ b/scripts/aznfs_install.sh @@ -132,7 +132,7 @@ perform_aznfs_update() AZNFS_RELEASE_SUSE="aznfs_sles-${RELEASE_NUMBER}-1" package_name=${AZNFS_RELEASE_SUSE}.x86_64.rpm else - if [[ "$distro_id" == "mariner" || ("$distro_id" == "rhel" && $(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d'.' -f1) == 7) ]] ; then + if [[ "$distro_id" == "mariner" || (("$distro_id" == "rhel" || "$distro_id" == "centos") && $(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d'.' -f1) == 7) ]] ; then AZNFS_RELEASE="aznfs_stunnel-${RELEASE_NUMBER}-1" package_name=${AZNFS_RELEASE}.x86_64.rpm else diff --git a/src/nfsv4mountscript.sh b/src/nfsv4mountscript.sh index b6bc38df..b7e410f8 100644 --- a/src/nfsv4mountscript.sh +++ b/src/nfsv4mountscript.sh @@ -295,42 +295,6 @@ check_if_notls_mount_exists() done } -update_timeout_from_mount_options() -{ - local timeout_string="timeo=" - local retry_string="retrans=" - local nfs_timeout=0 - local nfs_retry=0 - - # - # Check if timeout options are passed to mount command. - # - if [[ ! "$MOUNT_OPTIONS" == *"$timeout_string"* ]] && [[ ! "$MOUNT_OPTIONS" == *"$retry_string"* ]]; then - return 1 - fi - - IFS=',' - read -a options_arr <<< "$MOUNT_OPTIONS" - - for option in "${options_arr[@]}"; - do - if [[ "$option" == *"$timeout_string"* ]]; then - nfs_timeout=$(echo $option | cut -d= -f2) - fi - - if [[ "$option" == *"$retry_string"* ]]; then - nfs_retry=$(echo $option | cut -d= -f2) - fi - done - - if [ $nfs_timeout -ne 0 ]; then - MOUNT_TIMEOUT_IN_SECONDS=$(($nfs_timeout/10)) - fi - - if [ $nfs_retry -ne 0 ]; then - MOUNT_TIMEOUT_IN_SECONDS=$(($MOUNT_TIMEOUT_IN_SECONDS * $nfs_retry)) - fi -} # # Mount nfsv4 files share with TLS encryption. @@ -356,9 +320,6 @@ tls_nfsv4_files_share_mount() stunnel_conf_file="$STUNNELDIR/stunnel_$storageaccount_ip.conf" - # Should update default timeout based on timeo and retrans mount options. - update_timeout_from_mount_options - if [ ! -f $stunnel_conf_file ]; then EntryExistinMountMap="false" else