Go to main content

Developing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Create a Stencil Service

  1. Add a configfile type property group to the service.

    Property groups of type configfile tell SMF how to generate configuration files. This stencil service property group tells the svcio utility the path and ownership to use to create the configuration file. SMF regenerates configuration for stencil-aware services before running the start or refresh methods.

    Each configfile type 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.

    A configfile type property group has the following properties:

    path

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

    stencil

    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.

    mode

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

    owner

    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.

    group

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

  2. 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 the stencil. See the smf_stencil(5) man page for information about stencil file format.

    Put your stencil file in the /lib/svc/stencils directory, and specify the name of the stencil file as the value of the stencil property in the configfile type property group.