This procedure shows how to create a service that uses an existing custom script as the start method.
By default, svcbundle creates a transient service. Determine whether the start method script for this service 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.
In this example, the script that will be the start method script for this service is named ex_svc. Copy this script to /lib/svc/method/ex_svc.
In this example, the service name is site/ex_svc. This is a transient service and does not need a stop method.
$ svcbundle -o /tmp/ex_svc.xml -s service-name=site/ex_svc \ -s start-method=/lib/svc/method/ex_svc
Verify that the content of the /tmp/ex_svc.xml manifest is what you need. Add comments as needed.
Use the svccfg validate command to make sure the service manifest is valid.
$ cp /tmp/ex_svc.xml /lib/svc/manifest/site/ex_svc.xml
$ svcadm restart manifest-import
If you do not need to make any changes to the new service manifest, you can use the -i option to install the manifest as soon as it is created. The svcbundle command will write the manifest to /lib/svc/manifest/site and restart the manifest-import service. Any existing file with the same name in the /lib/svc/manifest/site directory will be overwritten.
# svcbundle -i -s service-name=site/ex_svc \ -s start-method=/lib/svc/method/ex_svc