- if [ "$(kernelverser)" -ge "002006" ]; then
- grep -q nfsd /proc/filesystems && \
- ! grep -q nfsd /proc/mounts && \
- run_cmd "Mounting /proc/fs/nfsd filesystem" mount -t nfsd nfsd /proc/fs/nfsd
- fi
- msg_starting "NFS exportfs"
- daemon /usr/sbin/exportfs -r
- msg_starting "NFS mountd"
- daemon rpc.mountd $RPCMOUNTOPTIONS
- if is_yes "$NFS4" ; then
- if (grep -q rpc_pipefs /proc/filesystems); then
- ! grep -q rpc_pipefs /proc/mounts && \
- run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
- if [ ! -f /var/lock/subsys/idmapd ]; then
- msg_starting "NFS idmapd"
- daemon rpc.idmapd $RPCIDMAPOPTIONS
- [ $? = 0 ] && touch /var/lock/subsys/idmapd
- fi
- msg_starting "NFS svcgssd"
- daemon rpc.svcgssd $RPCSVCGSSOPTIONS
- fi
- fi
- msg_starting "NFS daemon"
- daemon rpc.nfsd $RPCNFSDCOUNT
- touch /var/lock/subsys/nfs
- else
- msg_already_running "NFS daemon"
+ run_cmd "Mounting /proc/fs/nfsd filesystem" mount -t nfsd nfsd /proc/fs/nfsd
+ fi
+
+ # Set the ports lockd should listen on
+ if [ -n "$LOCKD_TCPPORT" ]; then
+ /sbin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1