System Administration Commands sharectl(1M)
NAME
sharectl - configure and manage file sharing service
SYNOPSIS
sharectl [-h]
sharectl status [-h] [protocol]
sharectl get [-h] [-p property]... protocol
sharectl set [-h] [-p property=value]... protocol
DESCRIPTION
The sharectl command operates on file-sharing protocols,
such as NFS. The command sets the client and server opera-
tional properties, takes and restores configuration snapshots, and gets status of the protocol service. The get and set subcommands (see below) require root privileges or that you assume the Primary Administratorrole. A non-privileged user can change the Solaris SMB
client's persistent settings when granted the SMBFS Manage-
ment rights profile in the /etc/user_attr file. See
user_attr(4) and rbac(5). An authorized user can use
sharectl to set global values for Solaris SMB server proper-
ties in the Solaris server management facility. See smb(4). OPTIONS The following options are supported:-h
Displays usage message.-p property[=value]
Specifies a property. See "Subcommands," below. Subcommandssharectl supports the subcommands described below. The form
of a sharectl command is:
# sharectl subcommand [option]
SunOS 5.11 Last change: 8 Sep 2010 1
System Administration Commands sharectl(1M)
get [-p property] protocol
Get the property values for the specified protocol. Ifno -p option is provided, get all the properties for the
specified protocol.set [-p property=value]... protocol
Set properties for the specified file sharing protocol. status [protocol]Display status of the specified protocol, or, if no pro-
tocol is specified, of all file-sharing protocols.
EXAMPLES
Example 1 Getting PropertiesThe following command gets the properties for the NFS proto-
col.% sharectl get nfs
lockd_listen_backlog=32
lockd_servers=20
lockd_retransmit_timeout=5
grace_period=90
nfsmapid_domain=sun.com
servers=16server_versmin=2
server_versmax=4
max_connections=-1
The following command gets the value of the grace_period
property for the NFS protocol.% sharectl get -p grace_period nfs
grace_period=90
Example 2 Setting a PropertySunOS 5.11 Last change: 8 Sep 2010 2
System Administration Commands sharectl(1M)
Note in the preceding example that the minimum version ofthe server NFS protocol (server_versmin) is set to 2. The
following command sets the minimum version number to version 3.% sharectl set -p server_versmin=3 nfs
Example 3 Obtaining StatusThe following command obtains the status of all file-sharing
protocols on a system.% sharectl status
nfs enabled Example 4 Configuring Global Settings The following command shows how an authorized user can usesharectl commands to configure global settings for the
ex.com environment in the service management facility (SMF). See nsmbrc(4) for a description of the example environment, ex.com. See smf(5) for a description of the SMF.# sharectl set -p section=default -p workgroup=SALES \
-p timeout=5 smbfs
# sharectl set -p section=FSERVER -p addr=fserv.ex.com smbfs
# sharectl set -p section=RSERVER -p workgroup=REMGROUP \
-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 \
-p timeout=25 smbfs
Example 5 Displaying Current Settings for SMBFS The following command shows how an authorized user can usethe sharectl get command to view the global settings for
smbfs in the SMF. The values shown are those set by the pre-
vious example.SunOS 5.11 Last change: 8 Sep 2010 3
System Administration Commands sharectl(1M)
# 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 Example 6 Setting Tracing of RPC Calls for autofs The following command expands each RPC call to autofs and logs it to the location specified for that service in automountd(1M).# sharectl set trace=1 autofs
EXIT STATUS 0 Successful completion.non-zero Command failed.
FILES /usr/include/libshare.h Error codes used for exit status.ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:SunOS 5.11 Last change: 8 Sep 2010 4
System Administration Commands sharectl(1M)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcs ||_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
SEE ALSO
automount(1M), automountd(1M), lockd(1M), mountd(1M), nfsd(1M), nfsmapid(1M), sharemgr(1M), nsmbrc(4),user_attr(4), attributes(5), rbac(5), smb(4), smf(5), stan-
dards(5)SunOS 5.11 Last change: 8 Sep 2010 5