SVCCFG(8) | Maintenance Commands and Procedures | SVCCFG(8) |
/usr/sbin/svccfg [-v] [-s FMRI]
/usr/sbin/svccfg [-v] [-s FMRI] subcommand [args]...
/usr/sbin/svccfg [-v] [-s FMRI] -f command-file
Changes made to an existing service in the repository typically do not take effect for that service until the next time the service instance is refreshed. See the refresh subcommand on the svcadm(8) man page for more details.
-f command-file
-s FMRI
-v
All subcommands that accept FMRIs also accept abbreviated or globbed patterns. Instances and services can be abbreviated by specifying the instance name, or the trailing portion of the service name. For example, given the FMRI:
svc:/network/smtp:sendmail
All the following are valid abbreviations:
sendmail :sendmail smtp smtp:sendmail network/smtp
While the following are invalid:
mail network network/smt
Abbreviated forms of FMRIs are unstable, and should not be used in scripts or other permanent tools. If a pattern matches more than one instance or service, an error message is printed and no action is taken.
repository repfile
Use repository only with files from the identical version of Solaris, including updates, that you are currently running. Do not use this subcommand with the system repository, /etc/svc/repository.db.
set [-v|-V]
-v
-V
extract [> file]
Without the -a option, property groups containing protected information (identified by the presence of the read_authorization property—see smf_security(7)) will be archived without their property values. When the -a option is specified, all values will be archived. An error results if there are insufficient privileges to read these values.
export [-a] service_FMRI [>file]
Without the -a option, property groups containing protected information (identified by the presence of the read_authorization property—see smf_security(7)) will be exported without their property values. When the -a option is specified, all values will be archived. An error results if there are insufficient privileges to read these values.
Note that export requires a service FMRI. To ease the use of arguments cut and pasted from other command output, if you specify a complete instance FMRI, the entire corresponding service including all instances is exported and a warning is issued. If you specify an abbreviation, such as apache2 or sendmail, that specifies an instance, the command fails.
import [-V] file
Services and instances in the manifest will be validated against template data in the manifest and the repository, and warnings will be issued for all template violations. See smf_template(7) for a description of templates. If the -V option is specified, manifests that violate the defined templates will fail to import. In interactive invocations of svccfg, -V is the default behavior.
For existing services and instances, properties which have not changed since the last import snapshot was taken are upgraded to those specified by the manifest. Conflicts (properties which have been changed both in the repository and the manifest) are reported on the standard error stream. svccfg will never upgrade the "general/enabled" and "general/restarter" properties, since they represent administrator preference.
inventory file
restore
Restoring an archive which is inconsistent with currently installed software (including patch revisions) might yield unpredictable results. Therefore, prior to restoring an archive, all system and application software, including any service manifests, should be restored to the same state it was in at the time the archive was made.
validate [file | fmri]
When you specify a file, the file is processed in a manner similar to import -V, but no changes are made to the repository. If any errors are detected, svccfg displays the errors and exits with a nonzero exit status.
For an instance fmri, instance entity selection, or snapshot entity selection, the specified instance in its composed form (see "Properties and Property Groups" in smf(7)) will be validated against template data in the repository. Instance FMRIs and instance entity selections use the "running" snapshot for validation. Warnings will be issued for all template violations. See smf_template(7) for a description of templates.
add name
delete [-f] {name | fmri}
list [pattern]
select {name | fmri}
unselect
addpropvalue pg/name [type:] value
delpg name
delprop pg[/name]
delpropvalue pg/name globpattern
describe [-v] [-t] [propertygroup/property]
When invoked without arguments, describe gives basic descriptions (if available) of the currently selected entity and all of its currently set property groups and properties. A property group or specific property can be queried by specifying either the property group name, or the property group name and property name, separated by a slash (/), as an argument.
The -v option gives all information available, including descriptions for current settings, constraints, and other possible setting choices.
The -t option shows only the template data for the selection (see smf_template(7)), and does not display the current settings for property groups and properties.
editprop
listpg [pattern]
In interactive mode, a basic description of the property groups is also given.
listprop [pattern]
setenv [-i | -s] [-m method_name] envvar value
Once the property is located, all values which begin with envvar followed by a "=" are removed, and the value "envvar=value" is added. See smf_security(7) for the privileges required to modify properties.
setprop pg/name = [type:] value
setprop pg/name = [type:] ([values ...])
unsetenv [-i | -s] [-m method_name] envvar value
Once the property is located, all values which begin with envvar followed by "=" are removed. See smf_security(7) for the privileges required to modify properties.
revert [snapshot]
selectsnap [name]
The following example imports a service description for the seismic service in the XML manifest specified on the command line.
# svccfg import /var/svc/manifest/site/seismic.xml
Note that the manifest must follow the format specified in service_bundle(5).
Example 2 Exporting a Service Description
To export a service description on the local system:
# svccfg export dumpadm >/tmp/dump.xml
Example 3 Deleting a Service Instance
To delete a service instance:
# svccfg delete network/inetd-upgrade:default
Example 4 Checking Properties in an Alternate Repository
To examine the state of a service's properties after loading an alternate repository, use the sequence of commands shown below. One might use such commands, for example, to determine whether a service was enabled in a particular repository backup.
# svccfg svc:> repository /etc/svc/repository-boot svc:> select telnet:default svc:/network/telnet:default> listprop general/enabled general/enabled boolean false svc:/network/telnet:default> exit
Example 5 Enabling Debugging
To modify LD_PRELOAD for a start method and enable the use of libumem(3LIB) with debugging features active:
$ svccfg -s system/service setenv LD_PRELOAD libumem.so $ svccfg -s system/service setenv UMEM_DEBUG default
Example 6 Using describe Subcommand
The following command illustrates the use of the describe subcommand.
# svccfg -s console-login describe ttymon ttymon application ttymon/device astring /dev/console terminal device to be used for the console login prompt ttymon/label astring console appropriate entry from /etc/ttydefs ...
0
1
2
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | See below. |
The interactive output is Uncommitted. The invocation and non-interactive output are Committed.
May 13, 2017 | OmniOS |