The remainder of this chapter explains how to use the Service Management Facility (SMF) to automatically handle system changes that should occur as a result of package action modification. See Managing System Services in Oracle Solaris 11.4 for more information about SMF services. Actuators that specify SMF service change are called SMF actuators. SMF actuator tags can be added to any action.
The following steps summarize how to specify SMF service change during pkg operations:
Determine which actions should cause a change to the system when they are installed, updated, or removed. For example, some system changes are needed to implement the software self-assembly concept described in Software Self-Assembly.
For each of those package actions, determine which existing SMF service provides the necessary system change. Alternatively, write a new service that provides the needed functionality and ensure that service is delivered to the system as described in Delivering an SMF Service.
When you have determined the set of actions that should cause a change to the system when they are installed, tag those actions in the package manifest to cause that system change to occur.
SMF actuators take a single service FMRI as a value. Fully specify the service instance to avoid ambiguity. With disable_fmri, refresh_fmri, and restart_fmri, you can use a glob that is accepted by the svcs command to match multiple service instances.
If the same service FMRI is tagged by multiple actions, possibly in multiple packages, the operation specified by that actuator is performed only once. For example, if multiple restart_fmri actuators specify the same FMRI, that service is restarted only one time for that pkg operation.
The following list of SMF actuators describes the effect on the service FMRI that is the value of each named actuator. In these descriptions, “uninstalling the package” also includes moving the file action that delivers the service to a different package.
Disable (svcadm disable) the specified service prior to uninstalling the package.
Refresh (svcadm refresh) the specified service after installing, updating, or uninstalling the package.
Restart (svcadm restart) the specified service after installing, updating, or uninstalling the package.
Temporarily disable (svcadm disable -t) the specified service prior to updating the package, and then enable (svcadm enable) the service after installing the package. The specified service value must be a fully specified service instance FMRI with no globbing characters. The suspend_fmri action can be performed only on services that are enabled and applies only to package update operations.
SMF actuators are not executed in the following cases:
When operating on an alternate root (pkg -R /path/to/BE).
When recursing from the global zone (pkg subcommand -r).
See the following sections for examples of using SMF actuators.