xref: /freebsd/usr.sbin/nfsd/nfsd.8 (revision 6b3455a7665208c366849f0b2b3bc916fb97516e)
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.
94It may also be specified in addition to any
95.Fl h
96options given.
97Note that NFS/UDP does not operate properly when
98bound to the wildcard IP address whether you use -a or do not use -h.
99.It Fl t
100Serve
101.Tn TCP NFS
102clients.
103.It Fl u
104Serve
105.Tn UDP NFS
106clients.
107.El
108.Pp
109For example,
110.Dq Li "nfsd -u -t -n 6"
111serves
112.Tn UDP
113and
114.Tn TCP
115transports using six daemons.
116.Pp
117A server should run enough daemons to handle
118the maximum level of concurrency from its clients,
119typically four to six.
120.Pp
121The
122.Nm
123utility listens for service requests at the port indicated in the
124.Tn NFS
125server specification; see
126.%T "Network File System Protocol Specification" ,
127RFC1094 and
128.%T "NFS: Network File System Version 3 Protocol Specification" .
129.Pp
130If
131.Nm
132detects that
133.Tn NFS
134is not loaded in the running kernel, it will attempt
135to load a loadable kernel module containing
136.Tn NFS
137support using
138.Xr kldload 2 .
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.
151If you do not use the option NFS may not respond to
152UDP packets from the same IP address they were sent to.
153Use of this option
154is also recommended when securing NFS exports on a firewalling machine such
155that the NFS sockets can only be accessed by the inside interface.
156The
157.Nm ipfw
158utility
159would then be used to block nfs-related packets that come in on the outside
160interface.
161.Pp
162The
163.Nm
164utility has to be terminated with
165.Dv SIGUSR1
166and cannot be killed with
167.Dv SIGTERM
168or
169.Dv SIGQUIT .
170The
171.Nm
172utility needs to ignore these signals in order to stay alive as long
173as possible during a shutdown, otherwise loopback mounts will
174not be able to unmount.
175If you have to kill
176.Nm
177just do a
178.Dq Li "kill -USR1 <PID of master nfsd>"
179.Sh DIAGNOSTICS
180.Ex -std
181.Sh SEE ALSO
182.Xr nfsstat 1 ,
183.Xr kldload 2 ,
184.Xr nfssvc 2 ,
185.Xr exports 5 ,
186.Xr ipfw 8 ,
187.Xr mountd 8 ,
188.Xr nfsiod 8 ,
189.Xr rpcbind 8
190.Sh HISTORY
191The
192.Nm
193utility first appeared in
194.Bx 4.4 .
195