Go to main content

Developing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Best Practices for Designing Goal Services

The following best practices are recommended for goal services:

  • Do not define a service that performs work to be a goal service. A goal service aggregates the state of a set of services. A service that performs work can be a dependency of a goal service. Because a goal service does not perform work, the value of the exec attribute of the exec_method element for start and stop methods can be simply :true.

  • In general, in the dependency element of a goal service, set the value of the grouping attribute to require_all, and set the value of the restart_on attribute to restart. See Dependency Groupings in Managing System Services in Oracle Solaris 11.4 and Showing Whether a Service Will Automatically Restart in Managing System Services in Oracle Solaris 11.4 for more information.

  • Dependencies of a goal service should be persistently enabled services, not dynamically enabled services. The goal service will remain in the maintenance state until the dynamically enabled dependency is enabled by another service or by an administrator. If you must include a dynamically-enabled dependency, set the value of the grouping attribute of the dependency to optional_all. Use the svcs -l command to check whether a dependency is persistently enabled (enabled across reboots). In the svcs -l output, the value of enabled is true for persistently enabled services.