1.\"	$NetBSD: mountd.8,v 1.43 2024/03/26 23:32:43 riastradh Exp $
2.\"
3.\" Copyright (c) 1989, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)mountd.8	8.4 (Berkeley) 4/28/95
31.\"
32.Dd February 16, 2021
33.Dt MOUNTD 8
34.Os
35.Sh NAME
36.Nm mountd
37.Nd service remote
38.Tn NFS
39mount requests
40.Sh SYNOPSIS
41.Nm
42.Op Fl dN
43.Op Fl P Ar policy
44.Op Fl p Ar port
45.Op Ar exportsfile ...
46.Sh DESCRIPTION
47.Nm
48is the server for
49.Tn NFS
50mount requests from other client machines.
51.Pp
52.Nm
53makes all filesystems listed in
54.Xr exports 5
55available to
56.Tn NFS
57clients, and then listens for mount service requests at the port
58indicated in the
59.Tn NFS
60server specification; see
61.%T "Network File System Protocol Specification" ,
62RFC 1094, Appendix A, and
63.%T "NFS: Network File System Version 3 Protocol Specification" ,
64Appendix I.
65.Pp
66Options and operands available for
67.Nm mountd :
68.Bl -tag -width Fl
69.It Fl d
70Enable debugging mode.
71.Nm
72will not detach from the controlling terminal and will print
73debugging messages to stderr.
74.It Fl N
75Do not require privileged ports for mount or NFS RPC calls.
76This option is equivalent to specifying
77.Ql -noresvport -noresvmnt
78on every export.
79See
80.Xr exports 5
81for more information.
82Some operating systems (notably Mac OS X) require this option.
83.It Fl P Ar policy
84IPsec
85.Ar policy
86string,
87as described in
88.Xr ipsec_set_policy 3 .
89Multiple IPsec policy strings may be specified by using a semicolon as
90a separator.
91If conflicting policy strings are found in a single line,
92the last string will take effect.
93If an invalid IPsec policy string is used
94.Nm
95logs an error message and terminates itself.
96.It Fl p Ar port
97Force
98.Nm
99to bind to the given port.
100If this option is not given,
101.Nm
102may bind to every anonymous port
103(in the range 600\^\(en1023) which causes trouble when trying to use
104NFS through a firewall.
105.It Ar exportsfile
106The
107.Ar exportsfile
108argument specifies an alternative location
109for the
110.Xr exports 5
111file.
112Multiple exports files can be defined.
113.El
114.Pp
115When
116.Nm
117is started,
118it loads the export host addresses and options into the kernel
119using the
120.Xr nfssvc 2
121system call.
122After changing the exports file,
123a hangup signal should be sent to the
124.Nm
125daemon to get it to reload the export information.
126After sending the
127.Dv SIGHUP
128.Pp
129.Dl kill \-s HUP $(cat /var/run/mountd.pid)
130.Pp
131check the syslog output to see if
132.Nm
133logged any parsing errors in the exports file.
134.Pp
135After receiving
136.Dv SIGTERM ,
137.Nm
138sends a broadcast request to remove the mount list from all the clients.
139This can take a long time, since the broadcast request waits for each
140client to respond.
141.Sh FILES
142.Bl -tag -width ".Pa /var/run/mountd.pid" -compact
143.It Pa /etc/exports
144the list of exported filesystems
145.It Pa /var/run/mountd.pid
146the pid of the currently running
147.Nm
148.It Pa /var/db/mountdtab
149the list of remotely mounted filesystems
150.El
151.Sh SEE ALSO
152.Xr nfsstat 1 ,
153.Xr nfssvc 2 ,
154.Xr ipsec_set_policy 3 ,
155.Xr exports 5 ,
156.Xr nfsd 8 ,
157.Xr rpcbind 8 ,
158.Xr showmount 8
159.Sh HISTORY
160The
161.Nm
162utility first appeared in
163.Bx 4.4 .
164