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