sharectl.1m revision aa83d55962a262cb794a1c25165fc467d78f6914

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 March 1, 2016 .Dt SHARECTL 1M .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 ro 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 4 , .Xr nfs 4 , .Xr smb 4 and smbfs.

p The .Cm set subcommand requires root privileges or that you assume the Primary Administrator role.

p 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: l -tag -width Ds t Fl h Displays usage message. Supported for all subcommands. t 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: l -tag -width Ds t 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

o see .Xr nsmbrc 4 and .Sx EXAMPLES

c . t 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

a /etc/default/nfs file. See .Xr nfs 4 . t Xo .Nm .Cm set ro Fl p Ar property Ns = Ns Ar value Brc Ns ... .Ar protocol .Xc Set properties for the specified file sharing protocol. t 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 l -tag -width Ds t Pa /usr/include/libshare.h Error codes used for exit status. .El .Sh EXIT STATUS l -tag -width Ds t Sy 0 Successful completion. t Sy non-zero Command failed. .El .Sh EXAMPLES l -tag -width Ds t Sy Example 1 No Setting a Property The following command sets the minimum version of the server NFS protocol to version 3. d -literal # sharectl -p server_versmin=3 nfs .Ed t Sy Example 2 No Getting Properties The following command gets the properties for the NFS protocol. d -literal # sharectl get nfs lockd_listen_backlog=32 lockd_servers=20 lockd_retransmit_timeout=5 grace_period=90 nfsmapid_domain=sun.com servers=16 server_versmin=2 server_versmax=4 max_connections=-1 .Ed

p The following command gets the value of the grace_period property for the NFS protocol. d -literal # sharectl get -p grace_period nfs grace_period=90 .Ed t Sy Example 3 No Obtaining Status The following command obtains the status of all file-sharing protocols on a system. d -literal # sharectl status nfs enabled .Ed t 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

a ex.com environment in the service management facility

q SMF . See .Xr nsmbrc 4 for a description of the example environment,

a ex.com . See .Xr smf 5 for a description of the SMF. d -literal # sharectl set -p section=default -p workgroup=SALES \e -p timeout=5 smbfs # sharectl set -p section=FSERVER -p addr=fserv.ex.com smbfs # sharectl set -p section=RSERVER -p workgroup=REMGROUP \e -p addr=rserv.ex.com smbfs # sharectl set -p section=RSERVER:george -p timeout=30 smbfs # sharectl set -p section="SSERV:*:POKY" -p addr=sserv.ex.com \e -p timeout=25 smbfs .Ed t 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. d -literal # sharectl get smbfs [default] workgroup=SALES timeout=5 [FSERVER] addr=fserv.ex.com [RSERVER] workgroup=REMGROUP addr=rserv.ex.com [RSERVER:george] timeout=30 [SSERV:*:POKY] addr=sserv.ex.com timeout=25 .Ed .El .Sh INTERFACE STABILITY .Sy Committed .Sh SEE ALSO .Xr sharemgr 1M , .Xr autofs 4 , .Xr nfs 4 , .Xr nsmbrc 4 , .Xr smb 4 , .Xr user_attr 4 , .Xr attributes 5 , .Xr rbac 5 , .Xr smf 5 , .Xr standards 5