JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 5: Standards, Environments, and Macros     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

Standards, Environments, and Macros

acl(5)

ad(5)

advance(5)

adv_cap_1000fdx(5)

adv_cap_1000hdx(5)

adv_cap_100fdx(5)

adv_cap_100hdx(5)

adv_cap_10fdx(5)

adv_cap_10hdx(5)

adv_cap_asym_pause(5)

adv_cap_autoneg(5)

adv_cap_pause(5)

adv_rem_fault(5)

ANSI(5)

architecture(5)

ars(5)

ascii(5)

attributes(5)

audit_binfile(5)

audit_flags(5)

audit_remote(5)

audit_syslog(5)

availability(5)

brands(5)

C++(5)

C(5)

cancellation(5)

cap_1000fdx(5)

cap_1000hdx(5)

cap_100fdx(5)

cap_100hdx(5)

cap_10fdx(5)

cap_10hdx(5)

cap_asym_pause(5)

cap_autoneg(5)

cap_pause(5)

cap_rem_fault(5)

charmap(5)

compile(5)

condition(5)

crypt_bsdbf(5)

crypt_bsdmd5(5)

crypt_sha256(5)

crypt_sha512(5)

crypt_sunmd5(5)

crypt_unix(5)

CSI(5)

datasets(5)

device_clean(5)

dhcp(5)

dhcp_modules(5)

environ(5)

eqnchar(5)

extendedFILE(5)

extensions(5)

fedfs(5)

filesystem(5)

fmri(5)

fnmatch(5)

formats(5)

fsattr(5)

grub(5)

gss_auth_rules(5)

hal(5)

iconv_1250(5)

iconv_1251(5)

iconv(5)

iconv_646(5)

iconv_852(5)

iconv_8859-1(5)

iconv_8859-2(5)

iconv_8859-5(5)

iconv_dhn(5)

iconv_koi8-r(5)

iconv_mac_cyr(5)

iconv_maz(5)

iconv_pc_cyr(5)

iconv_unicode(5)

ieee802.11(5)

ieee802.3(5)

ipfilter(5)

ipkg(5)

isalist(5)

ISO(5)

kerberos(5)

krb5_auth_rules(5)

krb5envvar(5)

KSSL(5)

kssl(5)

labels(5)

largefile(5)

ldap(5)

lf64(5)

lfcompile(5)

lfcompile64(5)

link_duplex(5)

link_rx_pause(5)

link_tx_pause(5)

link_up(5)

locale(5)

locale_alias(5)

lp_cap_1000fdx(5)

lp_cap_1000hdx(5)

lp_cap_100fdx(5)

lp_cap_100hdx(5)

lp_cap_10fdx(5)

lp_cap_10hdx(5)

lp_cap_asym_pause(5)

lp_cap_autoneg(5)

lp_cap_pause(5)

lp_rem_fault(5)

man(5)

mansun(5)

me(5)

mech_spnego(5)

mm(5)

ms(5)

MT-Level(5)

mutex(5)

MWAC(5)

mwac(5)

nfssec(5)

NIS+(5)

NIS(5)

nis(5)

nwam(5)

openssl(5)

pam_allow(5)

pam_authtok_check(5)

pam_authtok_get(5)

pam_authtok_store(5)

pam_deny(5)

pam_dhkeys(5)

pam_dial_auth(5)

pam_krb5(5)

pam_krb5_migrate(5)

pam_ldap(5)

pam_list(5)

pam_passwd_auth(5)

pam_pkcs11(5)

pam_rhosts_auth(5)

pam_roles(5)

pam_sample(5)

pam_smbfs_login(5)

pam_smb_passwd(5)

pam_tsol_account(5)

pam_tty_tickets(5)

pam_unix_account(5)

pam_unix_auth(5)

pam_unix_cred(5)

pam_unix_session(5)

pam_user_policy(5)

pam_zfs_key(5)

pkcs11_kernel(5)

pkcs11_kms(5)

pkcs11_softtoken(5)

pkcs11_tpm(5)

pkg(5)

POSIX.1(5)

POSIX.2(5)

POSIX(5)

privileges(5)

prof(5)

pthreads(5)

RBAC(5)

rbac(5)

regex(5)

regexp(5)

resource_controls(5)

sgml(5)

smf(5)

smf_bootstrap(5)

smf_method(5)

smf_restarter(5)

smf_security(5)

smf_template(5)

solaris10(5)

solaris(5)

solbook(5)

stability(5)

standard(5)

standards(5)

step(5)

sticky(5)

suri(5)

SUS(5)

SUSv2(5)

SUSv3(5)

SVID3(5)

SVID(5)

tecla(5)

teclarc(5)

term(5)

threads(5)

trusted_extensions(5)

vgrindefs(5)

wbem(5)

xcvr_addr(5)

xcvr_id(5)

xcvr_inuse(5)

XNS4(5)

XNS(5)

XNS5(5)

XPG3(5)

XPG4(5)

XPG4v2(5)

XPG(5)

zones(5)

smf_template

- service management framework support for service metadata

Description

Templates are defined by service developers to describe metadata about a service in general or individual configuration properties on a service, including human-consumable descriptions as well as definitions of valid configuration.

Administrators are provided access to templates through SMF commands that describe configuration values and validate configuration against templates.

Tool developers can use templates to provide more helpful user interfaces for service configuration.

Template Data

Service metadata is defined in the template as part of the service manifest.

Consuming Template Data

The svcs -lv and svccfg describe commands can be used to access metadata about properties in a human-readable format.

svccfg(1M)'s validate subcommand can be used to validate a service instance or manifest against template data. A set of libscf(3LIB) interfaces is available to access template data.

Template Definition

The sole interface to define templates is the service manifest.

Service authors should provide template metadata including common_names, descriptions, choices and constraints for service-specific property groups and properties which they introduce. At a minimum, service authors must provide descriptions for property groups and properties in the C locale. Service authors should not provide template metadata for framework-delivered property groups such as methods and dependencies.

See the EXAMPLES section for an example of authoring a template definition for a service.

Template Composition

All template interfaces search for template data about a property group first on the instance, then on the service, then on the service's restarter, and finally globally.

A property group template is defined by its author to apply to a specific instance, to a service and all of its instances, to a restarter's delegates, or globally. A typical service author defines the template on an instance or on a service. A template defined on an instance is applied to that instance only, and can override a template for that property group defined on the service. A template defined on the service is applied to all instances of that service.

Restarter authors can define templates in their manifest that apply to any service which uses their restarter, which is also known as a delegate. SMF framework authors have defined templates for property groups with well-known meanings to the entire SMF framework in the manifest for svc:/system/svc/global.

Templates defined globally or by the restarter and re-defined by the service or instance are flagged as a validation error. Service authors can avoid these errors by creating templates only for property groups specific to their service and not consumed by the SMF framework.

Property group templates can also be wildcarded by name or type. Only the most specific template definition applicable to a property group is honored.

Template Details

Service and Instance Templates

The template element defines the start of a template block. All further definitions below can be included in a template block. A template element can be contained in either a service or instance element. If it is contained in the service element, it applies to the service and all instances of that service. If it is contained in the instance element, it applies to only that instance of the service.

Whenever possible, we recommend defining the template data for the entire service.

<service ... >
   <template>
   </template>
</service>
Service and Instance Common Names

The entire service or instance can define a common name to describe the purpose of the service/instance.

<template>
  <common_name>
      <loctext xml:lang='C'>console login</loctext>
  </common_name>
<template>

common_name is a free-form string, but is intended to be used as a label in a GUI or CLI.

Use the following guidelines when defining a common name:

Service and Instance Descriptions

The description element contains a longer description of the property group, suitable for a status line or a tool-tip:

<template>
  <description>
     <loctext xml:lang='C'>Provide the text login prompt on console.
     </loctext>
  </description>
<template>

description Guidelines

Documentation

Documentation for this service can be defined explicitly, so that when the service is experiencing issues, or a consumer of the service wants more information on it, they can find it easily.

Property Groups

The pg_pattern element contains the definitions for a property group:

<template>
  <pg_pattern name="pgname" type="pgtype" target="this" required="true">
  </pg_pattern>
</template>

name is the property group's name, and type is the property group's type.

target specifies what the target of this definition is. "this" would refer to the defining service or instance. "instance" can only be used in a service's template block, and means the definition applies to all instances of this service. "delegate" can only be used in a restarter's template block, and applies to all instances that are delegated to that restarter. "all", only usable by the master restarter, would refer to all services on the system. The default value of target is "this".

required indicates whether this property group is required or not. The default value of required is false. If required is true, both name and type must be specified.

name and/or type can be omitted. If either of these attributes is omitted it is treated as a wildcard. For instance, if the name attribute is omitted from the pg_pattern definition, the pg_pattern is applied to all property groups that have the specified type.

Property Group Names

The common_name element contains the localized, human-readable name for the property group:

<pg_pattern ...>
  <common_name>
    <loctext xml:lang='C'>start method</loctext>
  </common_name>
</pg_pattern>

common_name is a free-form string, but is intended to be used as a label in a GUI or CLI.

See the guidelines for common_name under “Service Instance and Common Names,” above.

Property Group Description

The description element contains a longer description of the property group, suitable for a status line or a tool-tip:

<pg_pattern ...>
  <description>
    <loctext xml:lang='C'>A required method which starts the service.
   </loctext>
   </description>
</pg_pattern>

See the guidelines for specifying a description under “Service and Instance Descriptions,” above.

Properties

The prop_pattern element contains the definitions for a specific property:

<pg_pattern ...>
  <prop_pattern name="propname" type="proptype" required="true">
  </prop_pattern>
</pg_pattern>

name is the property's name, and type is the property's type.

required indicates whether this property is required. The default value of required is false.

name is always required. type is optional only if required is false.

Property Names

The common_name element contains the localized, human-readable name for the property:

common_name is a free-form string field, but is intended to be used as a label in a GUI or CLI.

<prop_pattern ...>
<common_name>
  <loctext xml:lang='C'>retry interval</loctext>
</common_name>
</prop_pattern>

See the guidelines for common_name under “Service Instance and Common Names,” above.

Property units

The units element contains the localized, human-readable units for a numerical property:

<prop_pattern ...>
  <units>
    <loctext xml:lang='C'>seconds</loctext>
  </units>
</prop_pattern>

units Guidelines

Property description

The description element contains a longer description of the property, suitable for a status line or a tool-tip:

<prop_pattern ...>
   <description> <loctext xml:lang='C'>
    The number of seconds to wait before retry.
    </loctext> </description>
</prop_pattern>

See the guidelines for specifying a description under “Service and Instance Descriptions,” above.

Property visibility

The visibility element specifies whether simplified views in higher level software might want to display this property.

<prop_pattern ...>
  <visibility value="hidden | readonly | readwrite"/>
</prop_pattern>

Some properties are internal implementation details and should not be presented as a configuration setting. Others might merely be read-only. This property is used to specify these restrictions. A value of hidden indicates that the property shouldn't be displayed, readonly means that the property isn't intended to be modified, and readwrite indicates the property is modifiable.

This is not a security mechanism, it is solely intended to help prevent the user from shooting himself in the foot, and to remove unnecessary clutter from CLI output or a GUI display. Hidden properties is visible in full-disclosure modes of many commands and UIs.

Property format

The cardinality and internal_separators elements constrain the structure of a property:

<prop_pattern ...>
  <cardinality min="1" max="1"/>
  <internal_separators>,</internal_separators>
</prop_pattern>

cardinality indicates the acceptable number of property values. min is the minimum number, and max is the maximum number. Both are optional. If neither is specified, <cardinality/> is the same as the default, zero or more values.

internal_separators specify the separator characters used for those property values into which multiple real values are packed.

Value constraints

The constraints element specifies what values are acceptable for a property:

<prop_pattern ...>
<constraints>
       <value name="blue" />
       <range min="1" max="7"/>
       <include_values type="values"/>
</constraints>
</prop_pattern>

The value element includes a possible property value. range includes an integer range.

value and range can be used in any combination, as restricting their use would prohibit many valid descriptions. If no value constraints are specified, the property can take on any value.

include_values includes all values specified by the values block (see Value Descriptions section).

Value choices

The choices block indicates which values a UI should offer the user:

<prop_pattern ...>
<choices>
      <range min="1" max="3"/>
      <value name="vt100" />
      <value name="xterm" />
      <include_values type="constraints"/>
      <include_values type="values"/>
</choices>
</prop_pattern>

range and value include ranges and individual values as they do for constraints.

include_values includes all values specified by either the constraints block or the values block (see next section).

Value Descriptions

Like property names, the values a property can take on can also have inscrutable representations. The values element contains localized, human-readable descriptions for specific property values:

<prop_pattern>
<values>
      <value name="blue">
              <common_name>
                      <loctext xml:lang='C'>blue</loctext>
              </common_name>
              <description>
                      <loctext xml:lang='C>
                              The color between green and indigo.
                      </loctext>
              </description>
      </value>
</values>
</prop_pattern>

common_name is a free-form string field, but is intended to be used as a label in a GUI or CLI.

See the guidelines for common_name under “Service Instance and Common Names,” above.

Examples

Assuming a basic service which wants to define basic templates data looks like this:

<?xml version="1.0"?
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='FOOfoo:foo'>
<service name='system/foo' type='service' version='1'>
      <dependency>
              name='multi-user'
              type='service'
              grouping='require_all'
              restart_on='none'
              <service_fmri value='svc:/milestone/multi-user' />
      </dependency>
      <exec_method
              type='method'
              name='start'
              exec='/opt/foo/food'
              timeout_seconds='60'>
      </exec_method>
      <exec_method
              type='method'
              name='stop'
              exec=':kill'
              timeout_seconds='60'>
      </exec_method>
      <property_group name='config' type='application'>
              <propval name='local_only' type='boolean' value='false' />
              <propval name='config_file' type='astring'
                  value='/opt/foo/foo.conf' />
      <property name='modules' type='astring'>
         <astring_list>
               <value_node value='bar'/>
               <value_node value='baz'/>
         </astring_list>
        </property>
      </property_group>

      <instance name='default' enabled='false' />
</service>
</service_bundle>

That service could define some basic templates data to help an administrator using this service inside of the <service> tags. The most helpful things are to document the purpose of the service itself and the service-specific configuration.

<template>
       <common_name> <loctext xml:lang='C'>
           all-purpose demonstration
       </loctext> </common_name>
       <documentation>
                <manpage title='food' section='1M'
                         manpath='/opt/foo/man' />
       </documentation>

       <pg_pattern name='config' type='application' target='this'
           required='true'>
               <description> <loctext xml:lang='C'>
                   Basic configuration for foo.
                </loctext> </description>
                <prop_pattern name='local_only' type='boolean'
                    required='false'>
                       <description> <loctext xml:lang='C'>
                           Only listen to local connection requests.
                       </loctext> </description>
                </prop_pattern>
                <prop_pattern name='config_file' type='astring'
                     required='true'>
                        <cardinality min='1' max='1'/>
                        <description> <loctext xml:lang='C'>
                             Configuration file for foo.
                         </loctext> </description>
                 </prop_pattern>
                 <prop_pattern name='modules' type='astring'
                     required='false'>
                         <description> <loctext xml:lang='C'>
                             Plugin modules for foo.
                          </loctext> /description>
                          <values>
                                   <value name='bar'>
                                   <description> <loctext xml:lang='C'>
                                       Allow foo to access the bar.
                                    </loctext> </description>
                                    </value>
                                    <value name='baz'>
                                    <description> <loctext xml:lang='C'>
                                       Allow foo to access baz functions.
                                    </loctext> </description>
                                    </value>
                                    <value name='qux'>
                                    <description> <loctext xml:lang='C'>
                                       Allow foo to access qux functions.
                                     </loctext> </description>
                                     </value>
                         </values>
                         <choices>
                             <include_values type='values'/>
                         </choices>
                  <prop_pattern>
        </pg_pattern>
</template>

Files

/usr/share/lib/xml/dtd/service_bundle.dtd.1

See Also

svcs(1), svccfg(1M), libscf(3LIB), service_bundle(4), smf(5)

/usr/apache2/2.2/man

http://httpd.apache.org