Managing System Services in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014

How to Create a Stencil Service

A stencil file contains a structural definition of a configuration file that continues to be required by a service even though that service is now managed by SMF. The svcio utility generates the configuration file from the definitions in the stencil file and properties in the SMF service. See the svcio(1) man page for more information about the svcio utility and the smf_stencil(4) man page for information about stencil file format.

  1. Create a stencil file.

    The stencil file tells the svcio utility the format to use to create the configuration file. The svcio utility converts SMF properties into application-specific configuration files based on a template called a stencil.

  2. Add a property group to the service.

    The stencil service property group tells the svcio utility the path and ownership to use to create the configuration file. SMF regenerates configuration for all stencil-aware services before running the start or refresh methods. Property groups of type configfile tell SMF how to generate configuration files. Each configfile property group describes a single configuration file for the service and tells svcio how to generate these files from other properties stored in the SMF repository.

    To configure a service to be stencil-aware, add a property group for each managed configuration file that contains the paths of both the stencil file to use as a template and the resulting configuration file. The property group has the following properties:


    The path to which to write the configuration file, for example /etc/svc.conf.


    The path of the stencil file to use, relative to /lib/svc/stencils. For example, if the value of the stencil property is svc.stencil, the /lib/svc/stencils/svc.stencil file will be used.


    The mode to use for the configuration file (path), for example 644.


    The owner to set for the configuration file (path). If this property is not set, the owner of the file is the user who invokes svcio.


    The group to set for the configuration file (path). If this property is not set, the group will be the default group for path.