Solaris System Manifest (SMF) Generator

Solaris System Manifest Generator

The Solaris Service Management Facility (SMF) is an update to the traditional UNIX /etc/init.d/ scripts. SMF provides better control of services, and allows for a standardised method for defining service properties. For example, under "Service Properties" below, you can specify the IP port number to use, the path to a configuration file, a userID to run as, the network address to listen on, or anything else that might be customisable for the service.

There is a good article on the subject at http://www.sun.com/bigadmin/content/selfheal/smf-quickstart.jsp, but in a nutshell, what you need to provide, is a startup/shutdown script (which may even be the exact same script as previously used in /etc/init.d) and an XML file which describes and defines the service.

Using this web page, you can specify how you want your service to work, and download an automatically generated ZIP file containing these two files, as well as a README file and a shell script which will register the service with the system.

Service Name

An SMF Service Name looks something like "svc:/system/zones:default". The Category is fixed; below that, you can put as many subsections as you like (even none), separated by the "/" slash character.

Add Subsection
Service Management

The service can be manually enabled via 'svcadm enable myapp'.

Service Properties

You can add any custom properties here that you want. These can be edited in svcprop, and accessed by the service to get custom configurations. Examples are: location of log files, network ports to use, username to run as, and so on. You can then edit the startup script to access these variables.

Add Variable
Startup and Shutdown

The Startup command is required; if you leave Shutdown blank, the processes will be killed. Refresh is optional. Any of the variables defined in "Service Properties" above are available in normal shell format. This can be used for user-settable fields, such as port number, config file, instance name, etc.

Startup
Shutdown
Refresh
Dependencies

You can probably leave most of these blank; Simply specify any services that your service depends upon, in the appropriate category (All, Any, or If-Enabled).

All of these are Required:
Any One of these is Required:
These are Required Only If Enabled:
Documentation

You can provide links here to the documentation for the system. This will be shown by the 'svcs myapp' command, amongst others.

( )

Download

Click this button to download a ZIP archive containing the necessary config XML, a sample startup/shutdown script, a README file explaining what to do, and a setup script to automate the whole thing for you.