Go to main content

Managing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: February 2022
 
 

Rereading Service Configuration

You can use the following methods to change service configuration:

  • Use the svccfg setprop command.

  • Edit the service manifest file.

  • Edit a profile or provide a new profile associated with the service.

When you change service configuration or provide new configuration, those changes do not immediately appear in the running snapshot. To apply configuration changes, refresh the service instances. This implementation enables you to make multiple changes to multiple services and then apply all the changes at once.

To apply changes you made by using the svccfg setprop command, you must use either the svcadm refresh or svccfg refresh command. The service instance must have a refresh method and must be in the online or degraded state.

To apply changes you made by modifying or adding manifest files or profiles, you can use either the svcadm refresh or svccfg refresh command, or you can restart the manifest-import service. The service instance must be in the online or degraded state. The manifest-import service updates the configuration of all running instances whose manifests or profiles have changed. The manifest-import service does not apply configuration changes that you made by using the svccfg setprop command. In addition to manually restarting the manifest-import service, booting the system and many pkg operations also restart the manifest-import service.

The svcadm refresh and svccfg refresh commands both perform the following steps:

  1. Create a new running snapshot to commit the editing properties into the running snapshot.

  2. Run the refresh method of the instance, if a refresh method exists and the instance is in the online or degraded state. The refresh method should notify the application that changes have been made. The refresh method might reread property values from the running snapshot. Even if no refresh method exists, the configuration in the running snapshot is updated.

    The periodic restarter does not attempt to run any refresh method. When a periodic instance is refreshed, the periodic restarter rereads the values of the properties in the periodic property group described in Storing Periodic Service Data in the Service Configuration Repository in Developing System Services in Oracle Solaris 11.4.

The svcadm refresh command operates on a service instance. The svccfg refresh command operates on a service instance or on a parent service. If a service is specified, the svccfg refresh command refreshes all instances of that service. While snapshots are taken only for service instances and not for parent services, parent service properties are inherited by service instances. Changed parent service properties appear in a service instance snapshot if the instance does not override those changes.

Some changes, such as dependency changes, take effect immediately. Other changes do not become effective until the service is restarted as described in Restarting a Service. Changes that cannot be made while the application is running require a refresh followed by a restart. Examples of changes that cannot be made while the application is running include closing or opening a socket or resetting an environment variable.

If you specify the -s option with the svcadm refresh command, svcadm refreshes the instance and waits for the instance to enter the online, degraded, or maintenance state before returning. The svcadm command returns when the instance reaches one of these states or when it determines that the instance requires administrator intervention to reach one of these states. Use the -T option with the -s option to specify an upper bound in seconds to make the transition or determine that the transition cannot be made.