diff --git a/mount/config-cobalt-linux b/mount/config-cobalt-linux index 1aef67e5d..ce5a0ddb6 100644 --- a/mount/config-cobalt-linux +++ b/mount/config-cobalt-linux @@ -3,3 +3,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-coherent-linux b/mount/config-coherent-linux index 9aa53aa46..316ea8c9f 100644 --- a/mount/config-coherent-linux +++ b/mount/config-coherent-linux @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-corel-linux b/mount/config-corel-linux index 3e0aa38a6..0117b5f87 100644 --- a/mount/config-corel-linux +++ b/mount/config-corel-linux @@ -4,3 +4,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-debian-linux b/mount/config-debian-linux index 20fdcd0a3..53b275cc8 100644 --- a/mount/config-debian-linux +++ b/mount/config-debian-linux @@ -6,3 +6,4 @@ nmblookup_path=nmblookup auto_file=/etc/am-utils/amd.conf autofs_file=/etc/auto.master show_used=1 +nfs_check=1 diff --git a/mount/config-freebsd b/mount/config-freebsd index 5ca156c4d..b64084014 100644 --- a/mount/config-freebsd +++ b/mount/config-freebsd @@ -6,3 +6,4 @@ smbclient_path=smbclient long_fstypes=1 fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-generic-linux b/mount/config-generic-linux index 1aef67e5d..ce5a0ddb6 100644 --- a/mount/config-generic-linux +++ b/mount/config-generic-linux @@ -3,3 +3,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-gentoo-linux b/mount/config-gentoo-linux index 6b05d71cb..c81ffdf2b 100644 --- a/mount/config-gentoo-linux +++ b/mount/config-gentoo-linux @@ -4,3 +4,4 @@ smbclient_path=smbclient nmblookup_path=nmblookup autofs_file=/etc/autofs/auto.master show_used=1 +nfs_check=1 diff --git a/mount/config-hpux b/mount/config-hpux index 5ca156c4d..b64084014 100644 --- a/mount/config-hpux +++ b/mount/config-hpux @@ -6,3 +6,4 @@ smbclient_path=smbclient long_fstypes=1 fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-lfs-linux b/mount/config-lfs-linux index b8b992dd2..5e502c09c 100644 --- a/mount/config-lfs-linux +++ b/mount/config-lfs-linux @@ -6,3 +6,4 @@ long_fstypes=1 smbclient_path= fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-macos b/mount/config-macos index 727db2057..6951d85b4 100644 --- a/mount/config-macos +++ b/mount/config-macos @@ -5,3 +5,4 @@ auto_file= smbclient_path=smbclient long_fstypes=1 show_used=1 +nfs_check=1 diff --git a/mount/config-mandrake-linux b/mount/config-mandrake-linux index 9aa53aa46..316ea8c9f 100644 --- a/mount/config-mandrake-linux +++ b/mount/config-mandrake-linux @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-msc-linux b/mount/config-msc-linux index 9aa53aa46..316ea8c9f 100644 --- a/mount/config-msc-linux +++ b/mount/config-msc-linux @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-netbsd b/mount/config-netbsd index 5ca156c4d..b64084014 100755 --- a/mount/config-netbsd +++ b/mount/config-netbsd @@ -6,3 +6,4 @@ smbclient_path=smbclient long_fstypes=1 fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-open-linux b/mount/config-open-linux index b9c4d6d40..eebfa0b7d 100644 --- a/mount/config-open-linux +++ b/mount/config-open-linux @@ -4,3 +4,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-open-linux-3.1e b/mount/config-open-linux-3.1e index 24794983d..8987fb910 100644 --- a/mount/config-open-linux-3.1e +++ b/mount/config-open-linux-3.1e @@ -4,3 +4,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-openbsd b/mount/config-openbsd index 5ca156c4d..b64084014 100644 --- a/mount/config-openbsd +++ b/mount/config-openbsd @@ -6,3 +6,4 @@ smbclient_path=smbclient long_fstypes=1 fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-openmamba-linux b/mount/config-openmamba-linux index 17cd9b3d9..cdc023489 100644 --- a/mount/config-openmamba-linux +++ b/mount/config-openmamba-linux @@ -4,3 +4,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-osf1 b/mount/config-osf1 index 2da618a93..2243257c3 100644 --- a/mount/config-osf1 +++ b/mount/config-osf1 @@ -6,3 +6,4 @@ long_fstypes=1 smbclient_path=/usr/local/samba/bin/smbclient fstab_file=/etc/fstab show_used=1 +nfs_check=1 diff --git a/mount/config-pardus-linux b/mount/config-pardus-linux index 1aef67e5d..ce5a0ddb6 100644 --- a/mount/config-pardus-linux +++ b/mount/config-pardus-linux @@ -3,3 +3,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-redhat-linux b/mount/config-redhat-linux index 17cd9b3d9..cdc023489 100644 --- a/mount/config-redhat-linux +++ b/mount/config-redhat-linux @@ -4,3 +4,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-redhat-linux-5.0-6.0 b/mount/config-redhat-linux-5.0-6.0 index 9177d6da3..5ffac97eb 100644 --- a/mount/config-redhat-linux-5.0-6.0 +++ b/mount/config-redhat-linux-5.0-6.0 @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-redhat-linux-6.1-ALL b/mount/config-redhat-linux-6.1-ALL index 9aa53aa46..316ea8c9f 100644 --- a/mount/config-redhat-linux-6.1-ALL +++ b/mount/config-redhat-linux-6.1-ALL @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-slackware-linux b/mount/config-slackware-linux index 25069bb0a..75687858a 100644 --- a/mount/config-slackware-linux +++ b/mount/config-slackware-linux @@ -3,3 +3,4 @@ long_fstypes=1 smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-sol-linux b/mount/config-sol-linux index a7a84140b..6cfcc5501 100644 --- a/mount/config-sol-linux +++ b/mount/config-sol-linux @@ -8,3 +8,4 @@ passwd_cindex=2 passwd_mindex=4 by_view=0 show_used=1 +nfs_check=1 diff --git a/mount/config-solaris b/mount/config-solaris index 6c2060768..521be4b10 100644 --- a/mount/config-solaris +++ b/mount/config-solaris @@ -4,3 +4,4 @@ long_fstypes=1 smbclient_path=/usr/local/samba/bin/smbclient nmblookup_path=/usr/local/samba/bin/nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-suse-linux b/mount/config-suse-linux index 288c8bde4..ec9266b24 100644 --- a/mount/config-suse-linux +++ b/mount/config-suse-linux @@ -4,3 +4,4 @@ autofs_file=/etc/auto.master smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-trustix-linux b/mount/config-trustix-linux index 9aa53aa46..316ea8c9f 100644 --- a/mount/config-trustix-linux +++ b/mount/config-trustix-linux @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-turbo-linux b/mount/config-turbo-linux index 9177d6da3..5ffac97eb 100644 --- a/mount/config-turbo-linux +++ b/mount/config-turbo-linux @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-turbo-linux-4.0 b/mount/config-turbo-linux-4.0 index 9177d6da3..5ffac97eb 100644 --- a/mount/config-turbo-linux-4.0 +++ b/mount/config-turbo-linux-4.0 @@ -5,3 +5,4 @@ fstab_file=/etc/fstab smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config-united-linux b/mount/config-united-linux index 288c8bde4..ec9266b24 100644 --- a/mount/config-united-linux +++ b/mount/config-united-linux @@ -4,3 +4,4 @@ autofs_file=/etc/auto.master smbclient_path=smbclient nmblookup_path=nmblookup show_used=1 +nfs_check=1 diff --git a/mount/config.info b/mount/config.info index 3141ce618..04ba53c87 100644 --- a/mount/config.info +++ b/mount/config.info @@ -11,3 +11,4 @@ auto_file=NFS automounts file,3 autofs_file=Kernel automounts file,3 smbclient_path=Full path to smbclient,3 nmblookup_path=Full path to nmblookup,3 +nfs_check=Check NFS servers before attempting mount,1,1-Yes,0-No diff --git a/mount/freebsd-lib.pl b/mount/freebsd-lib.pl index 61089a36a..9c53e5fe8 100755 --- a/mount/freebsd-lib.pl +++ b/mount/freebsd-lib.pl @@ -684,23 +684,25 @@ sub check_location if ($_[0] eq "nfs") { local($out, $temp, $mout, $dirlist); - # Use ping and showmount to see if the host exists and is up - if ($in{nfs_host} !~ /^\S+$/) { - &error("'$in{nfs_host}' is not a valid hostname"); - } - &execute_command("ping -c 1 '$in{nfs_host}'", undef, \$out, \$out); - if ($out =~ /unknown host/i) { - &error("The host '$in{nfs_host}' does not exist"); - } - elsif ($out =~ /100\% packet loss/) { - &error("The host '$in{nfs_host}' is down"); - } - &execute_command("showmount -e '$in{nfs_host}'", undef, \$out, \$out); - if ($out =~ /Unable to receive/) { - &error("The host '$in{nfs_host}' does not support NFS"); - } - elsif ($?) { - &error("Failed to get mount list : $out"); + if ($config{'nfs_check'}) { + # Use ping and showmount to see if the host exists and is up + if ($in{nfs_host} !~ /^\S+$/) { + &error("'$in{nfs_host}' is not a valid hostname"); + } + &execute_command("ping -c 1 '$in{nfs_host}'", undef, \$out, \$out); + if ($out =~ /unknown host/i) { + &error("The host '$in{nfs_host}' does not exist"); + } + elsif ($out =~ /100\% packet loss/) { + &error("The host '$in{nfs_host}' is down"); + } + &execute_command("showmount -e '$in{nfs_host}'", undef, \$out, \$out); + if ($out =~ /Unable to receive/) { + &error("The host '$in{nfs_host}' does not support NFS"); + } + elsif ($?) { + &error("Failed to get mount list : $out"); + } } # Validate directory name diff --git a/mount/hpux-lib.pl b/mount/hpux-lib.pl index 61240bd21..af6fd0bae 100755 --- a/mount/hpux-lib.pl +++ b/mount/hpux-lib.pl @@ -676,24 +676,26 @@ sub check_location if ($_[0] eq "nfs") { local($out, $temp, $mout, $dirlist); - # Use ping and showmount to see if the host exists and is up - if ($in{nfs_host} !~ /^\S+$/) { - &error("'$in{nfs_host}' is not a valid hostname"); - } - &execute_command("ping -c 1 '$in{nfs_host}'", undef, \$out, \$out); - if ($out =~ /unknown host/i) { - &error("The host '$in{nfs_host}' does not exist"); - } - elsif ($out =~ /100\% packet loss/) { - &error("The host '$in{nfs_host}' is down"); - } - &execute_command("showmount -e '$in{nfs_host}'", undef, \$out, \$out); - if ($out =~ /Unable to receive/) { - &error("The host '$in{nfs_host}' does not support NFS"); - } - elsif ($?) { - &error("Failed to get mount list : $out"); - } + if ($config{'nfs_check'}) { + # Use ping and showmount to see if the host exists and is up + if ($in{nfs_host} !~ /^\S+$/) { + &error("'$in{nfs_host}' is not a valid hostname"); + } + &execute_command("ping -c 1 '$in{nfs_host}'", undef, \$out, \$out); + if ($out =~ /unknown host/i) { + &error("The host '$in{nfs_host}' does not exist"); + } + elsif ($out =~ /100\% packet loss/) { + &error("The host '$in{nfs_host}' is down"); + } + &execute_command("showmount -e '$in{nfs_host}'", undef, \$out, \$out); + if ($out =~ /Unable to receive/) { + &error("The host '$in{nfs_host}' does not support NFS"); + } + elsif ($?) { + &error("Failed to get mount list : $out"); + } + } # Validate directory name foreach (split(/\n/, $out)) { diff --git a/mount/linux-lib.pl b/mount/linux-lib.pl index 89df5f55c..af6a3889f 100755 --- a/mount/linux-lib.pl +++ b/mount/linux-lib.pl @@ -1644,7 +1644,7 @@ sub check_location if (($_[0] eq "nfs") || ($_[0] eq "nfs4")) { local($out, $temp, $mout, $dirlist, @dirlist); - if (&has_command("showmount")) { + if (&has_command("showmount") && $config{'nfs_check'}) { # Use ping and showmount to see if the host exists and is up if ($in{nfs_host} !~ /^\S+$/) { &error(&text('linux_ehost', $in{'nfs_host'})); @@ -1665,21 +1665,21 @@ if (($_[0] eq "nfs") || ($_[0] eq "nfs4")) { elsif ($?) { &error(&text('linux_elist', $out)); } + } - # Validate directory name for NFSv3 (in v4 '/' exists) - foreach (split(/\n/, $out)) { - if (/^(\/\S+)/) { - $dirlist .= "$1\n"; - push(@dirlist, $1); - } + # Validate directory name for NFSv3 (in v4 '/' exists) + foreach (split(/\n/, $out)) { + if (/^(\/\S+)/) { + $dirlist .= "$1\n"; + push(@dirlist, $1); } - - if ($_[0] ne "nfs4" && $in{'nfs_dir'} !~ /^\/.*$/ && - &indexof($in{'nfs_dir'}, @dirlist) < 0) { - &error(&text('linux_enfsdir', $in{'nfs_dir'}, - $in{'nfs_host'}, "
$dirlist
")); - } - } + } + + if ($_[0] ne "nfs4" && $in{'nfs_dir'} !~ /^\/.*$/ && + &indexof($in{'nfs_dir'}, @dirlist) < 0) { + &error(&text('linux_enfsdir', $in{'nfs_dir'}, + $in{'nfs_host'}, "
$dirlist
")); + } # Try a test mount to see if filesystem is available $temp = &tempname(); diff --git a/mount/netbsd-lib.pl b/mount/netbsd-lib.pl index 60805ad1e..7a4cc84a4 100755 --- a/mount/netbsd-lib.pl +++ b/mount/netbsd-lib.pl @@ -522,23 +522,25 @@ sub check_location if ($_[0] eq "nfs") { local($out, $temp, $mout, $dirlist); - # Use ping and showmount to see if the host exists and is up - if ($in{nfs_host} !~ /^\S+$/) { - &error("'$in{nfs_host}' is not a valid hostname"); - } - $out = &backquote_command("ping -c 1 '$in{nfs_host}' 2>&1"); - if ($out =~ /unknown host/i) { - &error("The host '$in{nfs_host}' does not exist"); - } - elsif ($out =~ /100\% packet loss/) { - &error("The host '$in{nfs_host}' is down"); - } - $out = &backquote_command("showmount -e '$in{nfs_host}' 2>&1"); - if ($out =~ /Unable to receive/) { - &error("The host '$in{nfs_host}' does not support NFS"); - } - elsif ($?) { - &error("Failed to get mount list : $out"); + if ($config{'nfs_check'}) { + # Use ping and showmount to see if the host exists and is up + if ($in{nfs_host} !~ /^\S+$/) { + &error("'$in{nfs_host}' is not a valid hostname"); + } + $out = &backquote_command("ping -c 1 '$in{nfs_host}' 2>&1"); + if ($out =~ /unknown host/i) { + &error("The host '$in{nfs_host}' does not exist"); + } + elsif ($out =~ /100\% packet loss/) { + &error("The host '$in{nfs_host}' is down"); + } + $out = &backquote_command("showmount -e '$in{nfs_host}' 2>&1"); + if ($out =~ /Unable to receive/) { + &error("The host '$in{nfs_host}' does not support NFS"); + } + elsif ($?) { + &error("Failed to get mount list : $out"); + } } # Validate directory name diff --git a/mount/openbsd-lib.pl b/mount/openbsd-lib.pl index 59d04fa73..2652f6770 100755 --- a/mount/openbsd-lib.pl +++ b/mount/openbsd-lib.pl @@ -524,23 +524,25 @@ sub check_location if ($_[0] eq "nfs") { local($out, $temp, $mout, $dirlist); - # Use ping and showmount to see if the host exists and is up - if ($in{nfs_host} !~ /^\S+$/) { - &error("'$in{nfs_host}' is not a valid hostname"); - } - $out = &backquote_command("ping -c 1 '$in{nfs_host}' 2>&1"); - if ($out =~ /unknown host/i) { - &error("The host '$in{nfs_host}' does not exist"); - } - elsif ($out =~ /100\% packet loss/) { - &error("The host '$in{nfs_host}' is down"); - } - $out = &backquote_command("showmount -e '$in{nfs_host}' 2>&1"); - if ($out =~ /Unable to receive/) { - &error("The host '$in{nfs_host}' does not support NFS"); - } - elsif ($?) { - &error("Failed to get mount list : $out"); + if ($config{'nfs_check'}) { + # Use ping and showmount to see if the host exists and is up + if ($in{nfs_host} !~ /^\S+$/) { + &error("'$in{nfs_host}' is not a valid hostname"); + } + $out = &backquote_command("ping -c 1 '$in{nfs_host}' 2>&1"); + if ($out =~ /unknown host/i) { + &error("The host '$in{nfs_host}' does not exist"); + } + elsif ($out =~ /100\% packet loss/) { + &error("The host '$in{nfs_host}' is down"); + } + $out = &backquote_command("showmount -e '$in{nfs_host}' 2>&1"); + if ($out =~ /Unable to receive/) { + &error("The host '$in{nfs_host}' does not support NFS"); + } + elsif ($?) { + &error("Failed to get mount list : $out"); + } } # Validate directory name