svcio - create text files based on service configuration properties
/lib/svc/bin/svcio [-alux] [-f FMRI-instance] [-g group] [-i file] [-m mode] [-o file] [-O owner] [-R dir [-L opts [-p]]] [-S dir]
The svcio utility reads a template known as a stencil and emits text based on that file in conjunction with the properties from a service instance. In the typical case, svcio is used to generate application-specific configuration files for services that are managed by, but are not able to read their configurations from, SMF.
If the stencil itself contains any errors, svcio will provide a snippet of text along with a line number and the cause of the error. Unless the error would prevent further progress, each error is printed in the order it occurs in the file.
Error messages are printed to the standard error stream.
The following options are supported:
Process all files configured for an instance.
Specifically, svcio will look at all property groups with the type "configfile" and determine which stencil to use and where to write the resulting file by examing the values of the properties "path" and "stencil" within that property group. For example, if property group "conf1" is of the appropriate type, then svcio will use the value of "conf1/stencil" as the path of the stencil file and "conf1/path" as the path of the file to which to write the output. Additionally, the optional properties "owner" and "group" can be used to set the owner and group of the output file respectively. If the property group name or property name contains a reserved character (see smf(5)) then it must be encoded.
The FMRI of a service instance to run the stencil against.
The group to associate the output files with.
The path to the stencil file (default is stdin). This option cannot be used with –a option.
Lists all properties that would be referenced were a file is to be output.
Specifies options to be passed to mount(2) when loopback mounting output files. If this option is not specified, output files will not be loopback mounted. The –R switch is required with this option. A regular file will be written to the specified output path, rooted at prefix. This file will be loopback mounted to the specified output path, rooted at / or the value of the –R option.
Sets the mode for any output file (default is 644).
The path to the output file (default is stdout). This option cannot be used with –a option.
Sets the owner of the output files.
Sets the root prefix for all output files.
Creates non-existant intermediate directories in the output file path rooted at the value of the –R option. Note that this option will not create directories that are missing in the path to the mount point.
Looks for stencils in this directory rather than the default.
Unlinks output files and undo loopback mounting. No output files will be created.
Terminates svcio on the first error rather than continuing to the next stencil.
The following operands are supported:
A fault management resource identifier (FMRI) that specifies one or more instances (see smf(5)). FMRIs can be abbreviated by specifying the instance name, or the trailing portion of the service name. For example, given the FMRI:
The following are valid abbreviations:
sendmail :sendmail smtp smtp:sendmail network/smtp
The following are invalid abbreviations:
mail network network/smt
If the FMRI specifies a service, then the command applies to all instances of that service, except when used with the –D option.
Abbreviated forms of FMRIs are unstable, and should not be used in scripts or other permanent tools.
An FMRI that specifies an instance.
This example processes all configured configuration files for an instance:
example% svcio -a -f svc:/service:instanceExample 2 Removing All Configuration Files for an Instance
This example unlinks and unmounts all configured configuration files for an instance:
example% svcio -au -f svc:/service:instanceExample 3 Using an Unconfigured Stencil for an Instance
This example produces an output file based on a stencil that has not been configured:
example% svcio -o /etc/svc.conf -i ~/svc.stencil \ -f svc:/service1:instance
The following exit values are returned:
Successful command invocation.
A fatal error occurred as a result of a failed system call.
Invalid command line options were specified.
A fatal error occurred as a result of an unexpected SMF error.
An error occurred parsing a stencil.
See attributes(5) for descriptions of the following attributes: