Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS compatiblity #54

Open
advaleigh opened this issue Feb 16, 2018 · 1 comment
Open

macOS compatiblity #54

advaleigh opened this issue Feb 16, 2018 · 1 comment

Comments

@advaleigh
Copy link

I am attempting to get a NFS server working on macOS Sierra (10.12.6). java version "1.8.0_151". The same code works fine on CentOS 7.

In the macOS case, it successfully registers (visible in rpcinfo) and the bindings look correct. The system has the firewall disabled.

showmount -e fails with "showmount: Cannot retrieve info from host: localhost: RPC failed:: RPC: Procedure unavailable"

~aleigh$ rpcinfo -u localhost nfs
rpcinfo: RPC: Procedure unavailable
program 100003 version 0 is not available
rpcinfo: RPC: Procedure unavailable
program 100003 version 4294967295 is not available

~ aleigh$ rpcinfo -u localhost mountd
rpcinfo: RPC: Procedure unavailable
program 100005 version 0 is not available
rpcinfo: RPC: Procedure unavailable
program 100005 version 4294967295 is not available

I am willing to put in the time to fix this problem, but I wonder if this is a known issue, or if there is any advice.

public class NfsServer {
private static final MechaLogger logger = MechaLoggerFactory.getLogger(NfsServer.class);
private final OncRpcSvc service;

public NfsServer(VirtualFileSystem vfs, ExportFile exportFile) throws IOException {
    // create the RPC service which will handle NFS requests
    service = new OncRpcSvcBuilder()
            .withPort(2049)
            .withTCP()
            .withUDP()
            .withAutoPublish()
            .withWorkerThreadIoStrategy()
            .build();

    // create NFS v4.1 server
    //   NFSServerV41 nfs4 = new NFSServerV41(new MDSOperationFactory(), null, vfs, exportFile);

    // create NFS v3 and mountd servers
    NfsServerV3 nfs3 = new NfsServerV3(exportFile, vfs);
    MountServer mountd = new MountServer(exportFile, vfs);

    // register NFS servers at portmap service
    //  service.register(new OncRpcProgram(100003, 4), nfs4);
    service.register(new OncRpcProgram(100003, 3), nfs3);
    service.register(new OncRpcProgram(100005, 3), mountd);
}

public void run() {
    try {
        service.start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

public static void main(String args[]) throws IOException {
    NfsServer srv = new NfsServer(new SdsFs(), new ExportFile(new File("exports.nfs")));
    srv.run();
    ThreadUtil.forever();
}

}

@kofemann
Copy link
Member

kofemann commented Feb 19, 2018

Actually I expect that your simple example must work ander osx. Let me test and come back to you. Wat do you see when you run rpcinfo localhost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants