[pve-devel] [PATCH 3/3] NFS: replace rpcinfo with showmounts

Wolfgang Bumiller w.bumiller at proxmox.com
Thu May 21 10:24:52 CEST 2015


rpcinfo from rpcbind-0.2.1 in debian doesn't support ipv6 addresses.
At the same time the used command only actually tests for
portmapper/rpcbind availability, not for NFS directly.
Storage::scan_nfs uses /sbin/showmount to get a list of NFS exports from a
server and happily accepts ipv6 addresses. It is also more specific to NFS.

Replacing the rpcinfo call with showmount here means checking explicitly
for NFS and supporting IPv6 without the need for an updated rpcbind
package.
---
 PVE/Storage/NFSPlugin.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm
index 14aa4ed..68764b7 100644
--- a/PVE/Storage/NFSPlugin.pm
+++ b/PVE/Storage/NFSPlugin.pm
@@ -170,8 +170,7 @@ sub check_connection {
 
     my $server = $scfg->{server};
 
-    # test connection to portmapper
-    my $cmd = ['/usr/sbin/rpcinfo', '-p', $server];
+    my $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server];
 
     eval {
 	run_command($cmd, timeout => 2, outfunc => sub {}, errfunc => sub {});
-- 
2.1.4





More information about the pve-devel mailing list