1 .\"
   2 .\" The contents of this file are subject to the terms of the
   3 .\" Common Development and Distribution License (the "License").
   4 .\" You may not use this file except in compliance with the License.
   5 .\"
   6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   7 .\" or http://www.opensolaris.org/os/licensing.
   8 .\" See the License for the specific language governing permissions
   9 .\" and limitations under the License.
  10 .\"
  11 .\" When distributing Covered Code, include this CDDL HEADER in each
  12 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  13 .\" If applicable, add the following below this CDDL HEADER, with the
  14 .\" fields enclosed by brackets "[]" replaced with your own identifying
  15 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  16 .\"
  17 .\"
  18 .\" Copyright 1989 AT&T
  19 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
  20 .\" Copyright 2016 Nexenta Systems, Inc.
  21 .\" Copyright 2020 Joyent, Inc.
  22 .\"
  23 .Dd February 4, 2020
  24 .Dt NFSD 1M
  25 .Os
  26 .Sh NAME
  27 .Nm nfsd
  28 .Nd NFS daemon
  29 .Sh SYNOPSIS
  30 .Nm /usr/lib/nfs/nfsd
  31 .Op Fl a
  32 .Op Fl c Ar max_conn
  33 .Op Fl l Ar listen_backlog
  34 .Op Fl p Ar protocol
  35 .Op Fl t Ar device
  36 .Op Ar nservers
  37 .Sh DESCRIPTION
  38 .Nm
  39 is the daemon that handles client file system requests.
  40 Only users with
  41 .Brq Sy PRIV_SYS_NFS
  42 and sufficient privileges to write to
  43 .Pa /var/run
  44 can run this daemon.
  45 .Pp
  46 The
  47 .Nm
  48 daemon is automatically invoked using
  49 .Xr share 1M
  50 with the
  51 .Fl a
  52 option.
  53 .Pp
  54 By default,
  55 .Nm
  56 starts over the TCP and UDP transports for versions 2 and 3.
  57 By default, it starts over the TCP for version 4.
  58 You can change this with the
  59 .Fl p
  60 option.
  61 .Pp
  62 A previously invoked
  63 .Nm
  64 daemon started with or without options must be stopped before invoking another
  65 .Nm
  66 command.
  67 .Pp
  68 See
  69 .Xr nfs 4
  70 for available configuration properties for
  71 .Nm .
  72 .Ss Options
  73 The following options are supported:
  74 .Bl -tag -width Ds
  75 .It Fl a
  76 Start a NFS daemon over all available connectionless and connection-oriented
  77 transports, including UDP and TCP.
  78 Equivalent of setting the
  79 .Sy protocol
  80 property to
  81 .Sy all .
  82 .It Fl c Ar max_conn
  83 Set the maximum number of connections allowed to the NFS server over
  84 connection-oriented transports.
  85 By default, the number of connections is unlimited.
  86 Equivalent of the
  87 .Sy max_connections
  88 property.
  89 .It Fl l
  90 Set connection queue length for the NFS server over a connection-oriented
  91 transport.
  92 The default value is 32 entries.
  93 Equivalent of the
  94 .Sy listen_backlog
  95 property.
  96 .It Fl p Ar protocol
  97 Start a NFS daemon over the specified protocol.
  98 Equivalent of the
  99 .Sy protocol
 100 property.
 101 .It Fl t Ar device
 102 Start a NFS daemon for the transport specified by the given device.
 103 Equivalent of the
 104 .Sy device
 105 property.
 106 .El
 107 .Ss Operands
 108 The following operands are supported:
 109 .Bl -tag -width Ds
 110 .It Ar nservers
 111 This sets the maximum number of concurrent NFS requests that the server can
 112 handle.
 113 This concurrency is achieved by up to
 114 .Ar nservers
 115 threads created as needed in the kernel.
 116 .Ar nservers
 117 should be based on the load expected on this server.
 118 16 is the usual number of
 119 .Ar nservers .
 120 If
 121 .Ar nservers
 122 is not specified, the maximum number of concurrent NFS requests will default to
 123 1.
 124 Equivalent of the
 125 .Sy servers
 126 property.
 127 .El
 128 .Ss Usage
 129 If the
 130 .Sy nfs_portmon
 131 variable is set to non-zero value in
 132 .Pa /etc/system ,
 133 then clients are required to use privileged ports
 134 .Po ports <
 135 .Dv IPPORT_RESERVED
 136 .Pc
 137 to get NFS services.
 138 This variable is equal to zero by default.
 139 This variable has been moved from the
 140 .Qq nfs
 141 module to the
 142 .Qq nfssrv
 143 module.
 144 To set the variable, edit the
 145 .Pa /etc/system
 146 file and add this entry:
 147 .Bd -literal -offset indent
 148 set nfssrv:nfs_portmon = 1
 149 .Ed
 150 .Sh FILES
 151 .Bl -tag -width Ds
 152 .It Pa \&.nfsXXX
 153 Client machine pointer to an open-but-unlinked file.
 154 .It Pa /etc/system
 155 System configuration information file.
 156 .It Xo
 157 .Pa /var/nfs/v4_state
 158 .br
 159 .Pa /var/nfs/v4_oldstate
 160 .Xc
 161 Directories used by the server to manage client state information.
 162 These directories should not be removed.
 163 .El
 164 .Sh EXIT STATUS
 165 .Bl -tag -width Ds
 166 .It Sy 0
 167 Daemon started successfully.
 168 .It Sy 1
 169 Daemon failed to start.
 170 .El
 171 .Sh SEE ALSO
 172 .Xr svcs 1 ,
 173 .Xr mountd 1M ,
 174 .Xr share 1M ,
 175 .Xr sharectl 1M ,
 176 .Xr sharemgr 1M ,
 177 .Xr svcadm 1M ,
 178 .Xr nfs 4 ,
 179 .Xr sharetab 4 ,
 180 .Xr system 4 ,
 181 .Xr attributes 5 ,
 182 .Xr smf 5 ,
 183 .Xr zones 5
 184 .Sh NOTES
 185 Manually starting and restarting
 186 .Nm
 187 is not recommended.
 188 If it is necessary to do so, use
 189 .Nm svcadm
 190 to enable or disable the nfs service
 191 .Pq svc:/network/nfs/server .
 192 If it is disabled, it will be enabled by
 193 .Xr share_nfs 1M ,
 194 unless its
 195 .Sy application Ns / Ns Sy auto_enable
 196 property is set to
 197 .Sy false .
 198 See
 199 .Xr smf 5
 200 and
 201 .Xr svcadm 1M
 202 for more information.
 203 .Pp
 204 The
 205 .Nm
 206 service is managed by the service management facility,
 207 .Xr smf 5 ,
 208 under the service identifier:
 209 .Bd -literal -offset indent
 210 svc:/network/nfs/server
 211 .Ed
 212 .Pp
 213 Administrative actions on this service, such as enabling, disabling, or
 214 requesting restart, can be performed using
 215 .Xr svcadm 1M .
 216 The service's status can be queried using the
 217 .Xr svcs 1
 218 command.
 219 .Pp
 220 If
 221 .Nm
 222 is killed with
 223 .Sy SIGTERM ,
 224 it will not be restarted by the service management facility.
 225 Instead,
 226 .Nm
 227 can be restarted by other signals, such as
 228 .Sy SIGINT .
 229 .Pp
 230 NFS service, which includes
 231 .Nm ,
 232 can run inside a non-global zone.
 233 See the discussion under ZONES in
 234 .Xr nfs 4
 235 for more information.