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.4 and the model and startd/duration properties in the svcbundle(8) 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(8) 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