Managing System Services in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Convert a Run Control Script to an SMF Service

This procedure shows how to replace a run control script with an SMF service manifest so that the run control service can be managed by SMF. To convert a run control script, use the rc-script name with the -s option of the svcbundle command. See the svcbundle (1M) man page for more information or enter svcbundle help rc-script.

  1. Determine the service model.

    By default, svcbundle creates a transient service. Determine whether this run control script starts any long running daemon and is a contract service. See Service Models and the svc.startd (1M) man page for information about service models.

  2. Create an initial manifest.

    In this example, the service name is ex_con and is a contract service that runs at level 2.

    $ svcbundle -o /tmp/ex_con.xml -s service-name=ex_con
          -s rc-script=/etc/init.d/ex_con:2 -s model=contract
  3. Make any necessary changes to the manifest.

    Verify that the content of the /tmp/ex_con.xml manifest is what you need. Add comments as needed.

  4. Copy the manifest to the standard directory.
    $ cp /tmp/ex_con.xml /lib/svc/manifest/site/ex_con.xml
  5. Stop the existing service.
    $ /etc/init.d/ex_con stop
  6. Disable the run control script.

    Remove any links to the run control script from the appropriate rcn.d directories.

  7. Import the manifest and start the service.
    $ svcadm restart manifest-import
  8. List the new service.

    Verify that the new service exists and is in the expected state.

    $ svcs ex-con