Managing System Services in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

SMF Service

An SMF service is a persistently running application that represents a system entity such as the following:

  • Application services such as a database or a Web server

  • Essential system services

  • The software state of a device

  • Kernel configuration information

  • Milestones that correspond to a system init state

A service instance is a child of a service and provides capabilities and dependency relationships to applications and other service instances. Only instances have a state and can be started and stopped. If an instance fails for any reason, such as a hardware or software fault, SMF automatically detects the failure and restarts the instance and any dependent instances.

Instances of a service allow multiple configurations of a service to run simultaneously. Service instances inherit and customize common service configuration. For example, you can define a Web server service with one instance configured to listen on port 80 and another instance configured to listen on port 1008. Most services have a default instance. A few services do not have instances, such as some services that use SMF to store configurations but not to run programs. For example, the x11/x11-server service does not have any instances.

An SMF service is described in a file called a service manifest. The manifest describes service instances, dependencies, configuration properties, and methods. Service methods start, stop, and refresh service instances. A method can be a daemon, other binary executable, or an executable script. A service profile file enables you to customize an existing service, primarily by adding properties and adding and overriding property values. The new properties and values are layered over the values assigned in the manifest, as described in Repository Layers. See Service Bundles for more information about manifests and profiles. A profile is also an excellent tool for applying the same custom configuration to multiple systems, as described in Configuring Multiple Systems.

Service information is stored in the service configuration repository, which is also called the SMF database. The service configuration repository stores the current state of each service instance on the system and the configuration data for each service and service instance. The data is stored in layers according to how values were modified, as described in Repository Layers.

SMF provides actions that you can invoke on a service instance, including enable, disable, refresh, and restart. Each service instance is managed by a restarter, which performs these administrative actions. In general, restarters perform actions by executing methods to move the service instance from one state to another state. For more information about restarters, see Service Restarters.

A milestone service is a special type of service that represents a level of system readiness. A milestone is a service that other service instances depend on to start. For example, run levels are represented by milestone services such as svc:/milestone/multi-user-server. Milestones also can be used to indicate the readiness of a group of services, such as svc:/milestone/devices, svc:/milestone/network, or svc:/milestone/name-services.