xref: /freebsd/usr.sbin/mountd/mountd.8 (revision f93c028ac9fa8d9a86185da83b499017596d6d92)
18fae3551SRodney W. Grimes.\" Copyright (c) 1989, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
138fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
148fae3551SRodney W. Grimes.\"    without specific prior written permission.
158fae3551SRodney W. Grimes.\"
168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268fae3551SRodney W. Grimes.\" SUCH DAMAGE.
278fae3551SRodney W. Grimes.\"
2887564113SPeter Wemm.\"     @(#)mountd.8	8.4 (Berkeley) 4/28/95
297f3dea24SPeter Wemm.\" $FreeBSD$
308fae3551SRodney W. Grimes.\"
31*f93c028aSRick Macklem.Dd October 11, 2020
328fae3551SRodney W. Grimes.Dt MOUNTD 8
338fae3551SRodney W. Grimes.Os
348fae3551SRodney W. Grimes.Sh NAME
358fae3551SRodney W. Grimes.Nm mountd
368fae3551SRodney W. Grimes.Nd service remote
378fae3551SRodney W. Grimes.Tn NFS
388fae3551SRodney W. Grimesmount requests
398fae3551SRodney W. Grimes.Sh SYNOPSIS
407c7fb079SRuslan Ermilov.Nm
41*f93c028aSRick Macklem.Op Fl 2delnRrS
42d11e3645SMatteo Riondato.Op Fl h Ar bindip
43c203da27SBruce M Simpson.Op Fl p Ar port
4496968c22SPawel Jakub Dawidek.Op Ar exportsfile ...
458fae3551SRodney W. Grimes.Sh DESCRIPTION
46e1205e80SPhilippe CharnierThe
47e1205e80SPhilippe Charnier.Nm
48e1205e80SPhilippe Charnierutility is the server for
498fae3551SRodney W. Grimes.Tn NFS
508fae3551SRodney W. Grimesmount requests from other client machines.
5174853402SPhilippe CharnierIt listens for service requests at the port indicated in the
528fae3551SRodney W. Grimes.Tn NFS
538fae3551SRodney W. Grimesserver specification; see
548fae3551SRodney W. Grimes.%T "Network File System Protocol Specification" ,
55a62dc406SDoug RabsonRFC1094, Appendix A and
56a62dc406SDoug Rabson.%T "NFS: Network File System Version 3 Protocol Specification" ,
57b7e7ec5fSMark JohnstonRFC1813, Appendix I.
588fae3551SRodney W. Grimes.Pp
5974853402SPhilippe CharnierThe following options are available:
6074853402SPhilippe Charnier.Bl -tag -width indent
612a66cfc5SDoug Rabson.It Fl 2
6274853402SPhilippe CharnierAllow the administrator to force clients to use only the
6374853402SPhilippe Charnierversion 2
6474853402SPhilippe Charnier.Tn NFS
6574853402SPhilippe Charnierprotocol to mount file systems from this server.
662179ae1eSRick Macklem.It Fl d
672179ae1eSRick MacklemOutput debugging information.
682179ae1eSRick Macklem.Nm
692179ae1eSRick Macklemwill not detach from the controlling terminal and will print
702179ae1eSRick Macklemdebugging messages to stderr.
712179ae1eSRick Macklem.It Fl e
7279b86807SEdward Tomasz NapieralaIgnored; included for backward compatibility.
73d11e3645SMatteo Riondato.It Fl h Ar bindip
74d11e3645SMatteo RiondatoSpecify specific IP addresses to bind to for TCP and UDP requests.
75d11e3645SMatteo RiondatoThis option may be specified multiple times.
76d11e3645SMatteo RiondatoIf no
77d11e3645SMatteo Riondato.Fl h
78d11e3645SMatteo Riondatooption is specified,
79d11e3645SMatteo Riondato.Nm
80d11e3645SMatteo Riondatowill bind to
81d11e3645SMatteo Riondato.Dv INADDR_ANY .
82d11e3645SMatteo RiondatoNote that when specifying IP addresses with
83d11e3645SMatteo Riondato.Fl h ,
84d11e3645SMatteo Riondato.Nm
85d11e3645SMatteo Riondatowill automatically add
86d11e3645SMatteo Riondato.Li 127.0.0.1
87d11e3645SMatteo Riondatoand if IPv6 is enabled,
88d11e3645SMatteo Riondato.Li ::1
89d11e3645SMatteo Riondatoto the list.
90690c488dSGuido van Rooij.It Fl l
9174853402SPhilippe CharnierCause all succeeded
9274853402SPhilippe Charnier.Nm
9374853402SPhilippe Charnierrequests to be logged.
948fae3551SRodney W. Grimes.It Fl n
9574853402SPhilippe CharnierAllow non-root mount requests to be served.
968fae3551SRodney W. GrimesThis should only be specified if there are clients such as PC's,
978fae3551SRodney W. Grimesthat require it.
98a4a17097SRick MacklemIt will automatically clear the vfs.nfsd.nfs_privport sysctl flag, which
99099d4ed1SStephen McKaycontrols if the kernel will accept NFS requests from reserved ports only.
100c203da27SBruce M Simpson.It Fl p Ar port
101c203da27SBruce M SimpsonForce
102c203da27SBruce M Simpson.Nm
103c203da27SBruce M Simpsonto bind to the specified port, for both
104b18b186eSRuslan Ermilov.Dv AF_INET
105c203da27SBruce M Simpsonand
106b18b186eSRuslan Ermilov.Dv AF_INET6
107c203da27SBruce M Simpsonaddress families.
108c203da27SBruce M SimpsonThis is typically done to ensure that the port which
109c203da27SBruce M Simpson.Nm
110c203da27SBruce M Simpsonbinds to is a known quantity which can be used in firewall rulesets.
111c203da27SBruce M SimpsonIf
112c203da27SBruce M Simpson.Nm
113c203da27SBruce M Simpsoncannot bind to this port, an appropriate error will be recorded in
114c203da27SBruce M Simpsonthe system log, and the daemon will then exit.
115*f93c028aSRick Macklem.It Fl R
116*f93c028aSRick MacklemDo not support the Mount protocol and do not register with
117*f93c028aSRick Macklem.Xr rpcbind 8 .
118*f93c028aSRick MacklemThis can be done for NFSv4 only servers, since the Mount protocol is not
119*f93c028aSRick Macklemused by NFSv4.
120*f93c028aSRick MacklemUseful for NFSv4 only servers that do not wish to run
121*f93c028aSRick Macklem.Xr rpcbind 8 .
122*f93c028aSRick Macklem.Xr showmount 8
123*f93c028aSRick Macklemwill not work, however since NFSv4 mounts are not shown by
124*f93c028aSRick Macklem.Xr showmount 8 ,
125*f93c028aSRick Macklemthis should not be an issue for an NFSv4 only server.
126a62dc406SDoug Rabson.It Fl r
12774853402SPhilippe CharnierAllow mount RPCs requests for regular files to be served.
12887564113SPeter WemmAlthough this seems to violate the mount protocol specification,
12987564113SPeter Wemmsome diskless workstations do mount requests for
13087564113SPeter Wemmtheir swapfiles and expect them to be regular files.
13187564113SPeter WemmSince a regular file cannot be specified in
13287564113SPeter Wemm.Pa /etc/exports ,
13387564113SPeter Wemmthe entire file system in which the swapfiles resides
13487564113SPeter Wemmwill have to be exported with the
13587564113SPeter Wemm.Fl alldirs
13687564113SPeter Wemmflag.
1378fae3551SRodney W. Grimes.It Ar exportsfile
13874853402SPhilippe CharnierSpecify an alternate location
1398fae3551SRodney W. Grimesfor the exports file.
1403201fe06SPawel Jakub DawidekMore than one exports file can be specified.
141e6f3cb32SRick Macklem.It Fl S
142e6f3cb32SRick MacklemTell mountd to suspend/resume execution of the nfsd threads whenever
143e6f3cb32SRick Macklemthe exports list is being reloaded.
144e6f3cb32SRick MacklemThis avoids intermittent access
145e6f3cb32SRick Macklemerrors for clients that do NFS RPCs while the exports are being
146e6f3cb32SRick Macklemreloaded, but introduces a delay in RPC response while the reload
147e6f3cb32SRick Macklemis in progress.
148e6f3cb32SRick MacklemIf
149e6f3cb32SRick Macklem.Nm
150e6f3cb32SRick Macklemcrashes while an exports load is in progress,
151e6f3cb32SRick Macklem.Nm
152e6f3cb32SRick Macklemmust be restarted to get the nfsd threads running again, if this
153e6f3cb32SRick Macklemoption is used.
1548fae3551SRodney W. Grimes.El
1558fae3551SRodney W. Grimes.Pp
15674853402SPhilippe CharnierWhen
15774853402SPhilippe Charnier.Nm
15874853402SPhilippe Charnieris started,
1598fae3551SRodney W. Grimesit loads the export host addresses and options into the kernel
160fe27ded8SMike Pritchardusing the
161fe27ded8SMike Pritchard.Xr mount 2
162fe27ded8SMike Pritchardsystem call.
1638fae3551SRodney W. GrimesAfter changing the exports file,
16474853402SPhilippe Charniera hangup signal should be sent to the
16574853402SPhilippe Charnier.Nm
16674853402SPhilippe Charnierdaemon
1678fae3551SRodney W. Grimesto get it to reload the export information.
1688fae3551SRodney W. GrimesAfter sending the SIGHUP
16987564113SPeter Wemm(kill \-s HUP `cat /var/run/mountd.pid`),
17074853402SPhilippe Charniercheck the syslog output to see if
17174853402SPhilippe Charnier.Nm
17274853402SPhilippe Charnierlogged any parsing
1738fae3551SRodney W. Grimeserrors in the exports file.
174d599144dSGarrett Wollman.Pp
175d599144dSGarrett WollmanIf
17674853402SPhilippe Charnier.Nm
177d599144dSGarrett Wollmandetects that the running kernel does not include
178d599144dSGarrett Wollman.Tn NFS
179d599144dSGarrett Wollmansupport, it will attempt to load a loadable kernel module containing
180d599144dSGarrett Wollman.Tn NFS
181d599144dSGarrett Wollmancode, using
182933abef0SMaxime Henrion.Xr kldload 2 .
183d599144dSGarrett WollmanIf this fails, or no
184d599144dSGarrett Wollman.Tn NFS
1855e0abc7bSGuy HelmerKLD was available,
18674853402SPhilippe Charnier.Nm
187d599144dSGarrett Wollmanexits with an error.
1888fae3551SRodney W. Grimes.Sh FILES
1898fae3551SRodney W. Grimes.Bl -tag -width /var/run/mountd.pid -compact
1908fae3551SRodney W. Grimes.It Pa /etc/exports
1918fae3551SRodney W. Grimesthe list of exported file systems
1928fae3551SRodney W. Grimes.It Pa /var/run/mountd.pid
1938fae3551SRodney W. Grimesthe pid of the currently running mountd
19408b48e64SAndreas Schulz.It Pa /var/db/mountdtab
19508b48e64SAndreas Schulzthe current list of remote mounted file systems
1968fae3551SRodney W. Grimes.El
1978fae3551SRodney W. Grimes.Sh SEE ALSO
1988fae3551SRodney W. Grimes.Xr nfsstat 1 ,
199933abef0SMaxime Henrion.Xr kldload 2 ,
200bcc1d071SRick Macklem.Xr nfsv4 4 ,
2018fae3551SRodney W. Grimes.Xr exports 5 ,
2028fae3551SRodney W. Grimes.Xr nfsd 8 ,
2038657581bSMaxim Sobolev.Xr rpcbind 8 ,
2048fae3551SRodney W. Grimes.Xr showmount 8
2058fae3551SRodney W. Grimes.Sh HISTORY
2068fae3551SRodney W. GrimesThe
20774853402SPhilippe Charnier.Nm
208c0b0bcf4SMike Pritchardutility first appeared in
209c0b0bcf4SMike Pritchard.Bx 4.4 .
210