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