Go to main content

Managing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: August 2020

Restarting a Service

The restart operation only restarts instances that are currently running (in the online or degraded state). You might need to restart a running instance because you have made a configuration change that cannot be effected while the instance is running, for example.

Restarting a service instance does not refresh configuration. In general, the svcadm restart command runs the stop method of the instance and then runs the start method of the instance. The periodic restarter runs only the start method. The svcadm restart command does not commit property changes into the running snapshot and does not run the refresh method of the instance. See Rereading Service Configuration for information about committing configuration changes into the running snapshot.

Restarting the manifest-import service is a special case. Restarting the manifest-import service imports any changed manifests or profiles in standard locations, commits the changes into the service configuration repository, takes a new running snapshot, and runs the refresh method of changed instances if a refresh method exists.

How to Restart a Service Instance

  1. Check the instance state.

    The instance must be in the online or degraded state.

    $ svcs FMRI
  2. Restart the instance.

    The restarter for the service attempts to bring the specified instance to the online state. Most restarters implement the restart operation as a stop operation followed by a start operation.

    • Restart the instance.
      $ svcadm restart FMRI
    • Synchronously restart the instance.

      If you specify the -s option, svcadm restarts 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.

      $ svcadm restart -sT 10 FMRI
  3. Verify that the instance is started.

    If the restart is successful, the instance is in the online, degraded, or maintenance state. If the instance is in the degraded or maintenance state, see Repairing an Instance That Is Degraded, Offline, or in Maintenance.

    $ svcs FMRI