This section describes how to replace a run control script with an SMF service manifest so that the run control service can be managed by SMF.
This procedure describes how to use the rc-script property with the svcbundle command to convert a run control script to an SMF service.
By default, svcbundle creates a transient service. Determine whether this run control script starts any long-running daemon and therefore this service is a contract service. See Service Models in Managing System Services in Oracle Solaris 11.3, the model property in the svcbundle(1M) man page, and the startd/duration property in the svc.startd(1M) man page for information about service models.
To convert a run control script, use the rc-script property name with the -s option of the svcbundle command. See the rc-script property in the svcbundle(1M) man page for more information or enter svcbundle help rc-script.
In this example, the service name is ex_con and is a contract service that runs at level 2. The run level is specified after a colon after the script name in the rc-script property value.
$ svcbundle -o /tmp/ex_con.xml -s service-name=ex_con -s rc-script=/etc/init.d/ex_con:2 -s model=contract
Verify that the content of the /tmp/ex_con.xml manifest is what you need. You might need to add a dependency or adjust the method timeout, for example. Add comments to describe what the service does and how the properties of the service are used.
Use the svccfg validate command to ensure the service manifest is valid.
$ svccfg validate /tmp/ex_con.xml
$ cp /tmp/ex_con.xml /lib/svc/manifest/site/ex_con.xml
$ /etc/init.d/ex_con stop
Remove any links to the run control script from the appropriate rcn.d directories.
$ svcadm restart manifest-import
Verify that the new service exists and is in the expected state.
$ svcs ex-con