NFSv4 not able to set any sockets for nfsd without running rpcbind

15,782

This was a bug in NFS server kernel module. It was patched in December 2013.

Starting with kernel 3.14, rpcbind is no longer required to run in-kernel NFS server.

(assuming that server is configured to use only NFSv4 and higher)

http://lxr.free-electrons.com/source/net/sunrpc/svc.c?v=3.14#L966

You can find more information about that change in this thread:

http://www.spinics.net/lists/linux-nfs/msg41053.html

Therefore, your configuration:

MOUNTD_NFS_V2="no"
MOUNTD_NFS_V3="no"
RPCNFSDARGS="-N 2 -N 3"

should now work without rpcbind.

When you use only NFSv4, none of these services are required:

/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd
Share:
15,782

Related videos on Youtube

timmanna
Author by

timmanna

Updated on September 18, 2022

Comments

  • timmanna
    timmanna almost 2 years

    According to Red Hat docs 'rpcbind' is not required any more:

    Because protocol support has been incorporated into the v4 protocol, NFSv4 has no interaction with the portmap, rpc.lockd, and rpc.statd daemons. NFSv4 listens on the well-known TCP port 2049, which eliminates the need for portmap interaction. The mounting and locking protocols have been incorporated into the V4 protocol which eliminates the need for interaction with rpc.lockd and rpc.statd. The rpc.mountd daemon is still required on the server, but is not involved in any over-the-wire operations.

    however I'm not able to start NFS demon when 'rpcbind' service is not running:

    # service nfs start
    Starting NFS services:                                     [  OK  ]
    Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
    rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
                                                               [FAILED]
    Starting NFS mountd:                                       [  OK  ]
    Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
    rpc.nfsd: unable to set any sockets for nfsd
                                                               [FAILED]
    

    I've disabled NFS v2 and v3:

    # grep -v "^#" /etc/sysconfig/nfs
    MOUNTD_NFS_V2="no"
    MOUNTD_NFS_V3="no"
    RPCNFSDARGS="-N 2 -N 3"
    

    Could you please confirm what services are required/essential on server and client from these listed below (basically I would like to disable services which are not needed):

    # rpm -ql nfs-utils | grep 'init.d'
    /etc/rc.d/init.d/nfs
    /etc/rc.d/init.d/nfslock
    /etc/rc.d/init.d/rpcgssd
    /etc/rc.d/init.d/rpcidmapd
    /etc/rc.d/init.d/rpcsvcgssd
    
  • bgtvfr
    bgtvfr almost 7 years
    This answer is very low quality. OP has stated rpcbind was not required since nfsv4. The question has already been answered : it was a kernel bug.
  • Irfan Latif
    Irfan Latif over 4 years
    rpc.idmapd is only required for NFSv4. GSS is also required for Kerberos security. Though both are optional.