SmartOS SMF Manifest Config svccfg Cheat Sheet

2015, May 17  —  ...

If you're not familiar with the Service Management Facility (SMF) in Solaris and SmartOS (aka Smartmachine), then the man page necessarily the best way to learn it. Here are some helpful hints for using SMF's scvcfg.

Creating the SMF Manifest

  1. Create the service manifest xml file:

  2. Import

    $ svccfg import myservice.xml

Updating an SMF Manifest

  1. If you already have a service manifest xml file, you can make changes to it and re-import it.
  2. $ svccfg import manifest.xml
  3. Don't forget to restart your service.
  4. $ svcadm restart service-name
  5. Use the interactive svccfg shell:
$ svccfg

List child entities, if nothing is selected yet, this is the list of services:

svc:> list

Select a service:

svc:> select site/myservice

Lists all of the properties of the selected service:

svc:/site/myservice> listprop

List a specific property:

svc:/site/myservice> listprop start/exec

Open $EDITOR, probably vim, with a several commented out svc commands. Uncomment a setprop line, change the value, save, and quit:

svc:/site/myservice> editprop

Set a specific property:

svc:/site/myservice> setprop start/exec = astring: "myservice --arg1 --arg2"

Exit:

svc:/site/myservice> exit

After you make your changes, restart or refresh your service:

$ svcadm restart myservice