xref: /freebsd/usr.sbin/nfsd/nfsd.8 (revision c4f6a2a9e1b1879b618c436ab4f56ff75c73a0f5)
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 2 .
137If this fails, or no
138.Tn NFS
139KLD is available,
140.Nm
141will exit with an error.
142.Pp
143If
144.Nm
145is to be run on a host with multiple interfaces or interface aliases, use
146of the
147.Fl h
148option is recommended.  If you do not use the option NFS may not respond to
149UDP packets from the same IP address they were sent to.  Use of this option
150is also recommended when securing NFS exports on a firewalling machine such
151that the NFS sockets can only be accessed by the inside interface.
152The
153.Nm ipfw
154utility
155would then be used to block nfs-related packets that come in on the outside
156interface.
157.Pp
158The
159.Nm
160utility has to be terminated with
161.Dv SIGUSR1
162and cannot be killed with
163.Dv SIGTERM
164or
165.Dv SIGQUIT .
166The
167.Nm
168utility needs to ignore these signals in order to stay alive as long
169as possible during a shutdown, otherwise loopback mounts will
170not be able to unmount.
171If you have to kill
172.Nm
173just do a
174.Dq Li "kill -USR1 <PID of master nfsd>"
175.Sh DIAGNOSTICS
176.Ex -std
177.Sh SEE ALSO
178.Xr nfsstat 1 ,
179.Xr kldload 2 ,
180.Xr nfssvc 2 ,
181.Xr ipfw 8 ,
182.Xr mountd 8 ,
183.Xr nfsiod 8 ,
184.Xr rpcbind 8
185.Sh HISTORY
186The
187.Nm
188utility first appeared in
189.Bx 4.4 .
190