1.\" Copyright (c) 1989, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 33.\" $FreeBSD$ 34.\" 35.Dd March 29, 1995 36.Dt NFSD 8 37.Os 38.Sh NAME 39.Nm nfsd 40.Nd remote 41.Tn NFS 42server 43.Sh SYNOPSIS 44.Nm 45.Op Fl ardut 46.Op Fl n Ar num_servers 47.Op Fl h Ar bindip 48.Sh DESCRIPTION 49The 50.Nm 51utility runs on a server machine to service 52.Tn NFS 53requests from client machines. 54At least one 55.Nm 56must be running for a machine to operate as a server. 57.Pp 58Unless otherwise specified, four servers for 59.Tn UDP 60transport are started. 61.Pp 62The following options are available: 63.Bl -tag -width Ds 64.It Fl r 65Register the 66.Tn NFS 67service with 68.Xr rpcbind 8 69without creating any servers. 70This option can be used along with the 71.Fl u 72or 73.Fl t 74options to re-register NFS if the rpcbind server is restarted. 75.It Fl d 76Unregister the 77.Tn NFS 78service with 79.Xr rpcbind 8 80without creating any servers. 81.It Fl n 82Specifies how many servers to create. 83.It Fl h Ar bindip 84Specifies which IP address or hostname to bind to on the local host. 85This option is recommended when a host has multiple interfaces. 86Multiple 87.Fl h 88options may be specified. 89.It Fl a 90Specifies that nfsd should bind to the wildcard IP address. 91This is the default if no 92.Fl h 93options are given. It may also be specified in addition to any 94.Fl h 95options given. Note that NFS/UDP does not operate properly when 96bound to the wildcard IP address whether you use -a or do not use -h. 97.It Fl t 98Serve 99.Tn TCP NFS 100clients. 101.It Fl u 102Serve 103.Tn UDP NFS 104clients. 105.El 106.Pp 107For example, 108.Dq Li "nfsd -u -t -n 6" 109serves 110.Tn UDP 111and 112.Tn TCP 113transports using six daemons. 114.Pp 115A server should run enough daemons to handle 116the maximum level of concurrency from its clients, 117typically four to six. 118.Pp 119The 120.Nm 121utility listens for service requests at the port indicated in the 122.Tn NFS 123server specification; see 124.%T "Network File System Protocol Specification" , 125RFC1094 and 126.%T "NFS: Network File System Version 3 Protocol Specification" . 127.Pp 128If 129.Nm 130detects that 131.Tn NFS 132is not loaded in the running kernel, it will attempt 133to load a loadable kernel module containing 134.Tn NFS 135support using 136.Xr kldload 8 137by way of 138.Xr vfsload 3 . 139If this fails, or no 140.Tn NFS 141KLD is available, 142.Nm 143will exit with an error. 144.Pp 145If 146.Nm 147is to be run on a host with multiple interfaces or interface aliases, use 148of the 149.Fl h 150option is recommended. If you do not use the option NFS may not respond to 151UDP packets from the same IP address they were sent to. Use of this option 152is also recommended when securing NFS exports on a firewalling machine such 153that the NFS sockets can only be accessed by the inside interface. 154The 155.Nm ipfw 156utility 157would then be used to block nfs-related packets that come in on the outside 158interface. 159.Pp 160The 161.Nm 162utility has to be terminated with 163.Dv SIGUSR1 164and cannot be killed with 165.Dv SIGTERM 166or 167.Dv SIGQUIT . 168The 169.Nm 170utility needs to ignore these signals in order to stay alive as long 171as possible during a shutdown, otherwise loopback mounts will 172not be able to unmount. 173If you have to kill 174.Nm 175just do a 176.Dq Li "kill -USR1 <PID of master nfsd>" 177.Sh DIAGNOSTICS 178.Ex -std 179.Sh SEE ALSO 180.Xr nfsstat 1 , 181.Xr nfssvc 2 , 182.Xr ipfw 8 , 183.Xr kldload 8 , 184.Xr mountd 8 , 185.Xr nfsiod 8 , 186.Xr rpcbind 8 187.Sh HISTORY 188The 189.Nm 190utility first appeared in 191.Bx 4.4 . 192