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 (c) 2007, Sun Microsystems, Inc. All Rights Reserved 19 .\" Copyright 2016 Nexenta Systems, Inc. 20 .\" 21 .Dd December 16, 2016 22 .Dt SHARECTL 1M 23 .Os 24 .Sh NAME 25 .Nm sharectl 26 .Nd configure and manage file sharing services 27 .Sh SYNOPSIS 28 .Nm 29 .Ar subcommand 30 .Op Fl h 31 .Nm 32 .Cm delsect 33 .Ar section protocol 34 .Nm 35 .Cm get 36 .Oo Fl p Ar property Oc Ns ... 37 .Ar protocol 38 .Nm 39 .Cm set 40 .Bro Fl p Ar property Ns = Ns Ar value Brc Ns ... 41 .Ar protocol 42 .Nm 43 .Cm status 44 .Op Ar protocol 45 .Sh DESCRIPTION 46 The 47 .Nm 48 command operates on file sharing services. The command sets the client and 49 server operational properties, takes and restores configuration snapshots, and 50 gets status of the protocol service. Currently supported services are 51 .Xr autofs 4 , 52 .Xr nfs 4 , 53 .Xr smb 4 54 and smbfs. 55 .Pp 56 The 57 .Cm set 58 subcommand requires root privileges or that you assume the Primary Administrator 59 role. 60 .Pp 61 A non-privileged user can change the persistent settings when granted required 62 authorizations, see appropriate sharing protocol man page. 63 .Ss Options 64 The following options are supported where applicable: 65 .Bl -tag -width Ds 66 .It Fl h 67 Displays usage message. Supported for all subcommands. 68 .It Fl p Ar property Ns Op = Ns Ar value 69 Specifies a property. See 70 .Sx Subcommands , 71 below. 72 .El 73 .Ss Subcommands 74 .Nm 75 supports the subcommands described below: 76 .Bl -tag -width Ds 77 .It Xo 78 .Nm 79 .Cm delsect 80 .Ar section protocol 81 .Xc 82 Delete configuration section for the specified protocol. Currently only protocol 83 that has configuration sections is 84 .Nm smbfs 85 .Po see 86 .Xr nsmbrc 4 87 and 88 .Sx EXAMPLES 89 .Pc . 90 .It Xo 91 .Nm 92 .Cm get 93 .Oo Fl p Ar property Oc Ns ... 94 .Ar protocol 95 .Xc 96 Get the property values for the specified protocol. If no 97 .Fl p 98 option is provided, get all the properties for the specified protocol. For NFS, 99 properties correspond to entries in the 100 .Pa /etc/default/nfs 101 file. See 102 .Xr nfs 4 . 103 .It Xo 104 .Nm 105 .Cm set 106 .Bro Fl p Ar property Ns = Ns Ar value Brc Ns ... 107 .Ar protocol 108 .Xc 109 Set properties for the specified file sharing protocol. 110 .It Xo 111 .Nm 112 .Cm status 113 .Op Ar protocol 114 .Xc 115 Display status of the specified protocol, or, if no protocol is specified, of 116 all file sharing protocols. 117 .El 118 .Sh FILES 119 .Bl -tag -width Ds 120 .It Pa /usr/include/libshare.h 121 Error codes used for exit status. 122 .El 123 .Sh EXIT STATUS 124 .Bl -tag -width Ds 125 .It Sy 0 126 Successful completion. 127 .It Sy non-zero 128 Command failed. 129 .El 130 .Sh EXAMPLES 131 .Bl -tag -width Ds 132 .It Sy Example 1 No Setting a Property 133 The following command sets the minimum version of the server NFS protocol to 134 version 3. 135 .Bd -literal 136 # sharectl -p server_versmin=3 nfs 137 .Ed 138 .It Sy Example 2 No Getting Properties 139 The following command gets the properties for the NFS protocol. 140 .Bd -literal 141 # sharectl get nfs 142 lockd_listen_backlog=32 143 lockd_servers=256 144 lockd_retransmit_timeout=5 145 grace_period=90 146 nfsmapid_domain=sun.com 147 servers=1024 148 server_versmin=2 149 server_versmax=4 150 max_connections=-1 151 .Ed 152 .Pp 153 The following command gets the value of the grace_period property for the NFS 154 protocol. 155 .Bd -literal 156 # sharectl get -p grace_period nfs 157 grace_period=90 158 .Ed 159 .It Sy Example 3 No Obtaining Status 160 The following command obtains the status of all file-sharing protocols on a 161 system. 162 .Bd -literal 163 # sharectl status 164 nfs enabled 165 .Ed 166 .It Sy Example 4 No Configuring Global Settings 167 The following command shows how an authorized user can use 168 .Nm 169 commands to configure global settings for the 170 .Pa ex.com 171 environment in the service management facility 172 .Pq SMF . 173 See 174 .Xr nsmbrc 4 175 for a description of the example environment, 176 .Pa ex.com . 177 See 178 .Xr smf 5 179 for a description of the SMF. 180 .Bd -literal 181 # sharectl set -p section=default -p workgroup=SALES \e 182 -p timeout=5 smbfs 183 # sharectl set -p section=FSERVER -p addr=fserv.ex.com smbfs 184 # sharectl set -p section=RSERVER -p workgroup=REMGROUP \e 185 -p addr=rserv.ex.com smbfs 186 # sharectl set -p section=RSERVER:george -p timeout=30 smbfs 187 # sharectl set -p section="SSERV:*:POKY" -p addr=sserv.ex.com \e 188 -p timeout=25 smbfs 189 .Ed 190 .It Sy Example 5 No Displaying Current Settings 191 The following command shows how an authorized user can use the 192 .Nm sharectl Cm get 193 command to view the global settings for 194 .Nm smbfs 195 in the SMF. The values shown are those set by the previous example. 196 .Bd -literal 197 # sharectl get smbfs 198 [default] 199 workgroup=SALES 200 timeout=5 201 [FSERVER] 202 addr=fserv.ex.com 203 [RSERVER] 204 workgroup=REMGROUP 205 addr=rserv.ex.com 206 [RSERVER:george] 207 timeout=30 208 [SSERV:*:POKY] 209 addr=sserv.ex.com 210 timeout=25 211 .Ed 212 .El 213 .Sh INTERFACE STABILITY 214 .Sy Committed 215 .Sh SEE ALSO 216 .Xr sharemgr 1M , 217 .Xr autofs 4 , 218 .Xr nfs 4 , 219 .Xr nsmbrc 4 , 220 .Xr smb 4 , 221 .Xr user_attr 4 , 222 .Xr attributes 5 , 223 .Xr rbac 5 , 224 .Xr smf 5 , 225 .Xr standards 5