Skip to content

Commit

Permalink
Centos7
Browse files Browse the repository at this point in the history
  • Loading branch information
Sepideh Roghanchi committed Nov 13, 2024
1 parent 8039b29 commit 14c40e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
2 changes: 1 addition & 1 deletion packaging/aznfs/RPM/aznfs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/aznfs_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 0 additions & 39 deletions src/nfsv4mountscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 14c40e9

Please sign in to comment.