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
-
Create the service manifest xml file:
-
Use manifold
$ sudo pkgin install manifold $ manifold myservice.xml
- Write your own.
- Ben Rockwood's SMF Manifest Cheatsheet
-
Examples:
- Mosca service manifest
- SMF Manfiest Recipes on smartos.org
/opt/local/share/smf
/var/svc/manifest
-
-
Import
$ svccfg import myservice.xml
Updating an SMF Manifest
- If you already have a service manifest xml file, you can make changes to it and re-import it.
$ svccfg import manifest.xml
- Don't forget to restart your service.
$ svcadm restart service-name
- 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