Building manifests with manifold

Modified: 28 Apr 2022 01:26 UTC

Typically, to produce a manifest, you need to open a text editor and manually write the XML yourself. However, writing XML in this way is time consuming, tedious and error prone.

An alternative to writing out the manifest is to use a tool that automatically builds the manifest. The tool of choice at Joyent is manifold. With manifold, you can quickly generate manifests for custom applications by simply answering a few questions. You can install this on SmartOS SmartMachines through pkgsrc.

Installing manifold

To install manifold:

  1. SSH into your machine.
  2. Run the installation command:

    # pkgin in manifold

Building a manifest with manifold

To build a manifest, run this command:

# manifold myservice.xml

The reference to "myservice.xml" is the name of the manifest you want to generate. manifold will then prompt you for a series of answers. The answers you provide define the scope of the manifest. For example:

# manifold myservice.xml
The service category (example: 'site' or '/application/database') [site] site

The name of the service, which follows the service category
   (example: 'myapp') [] Superfly

The version of the service manifest (example: '1') [1] 1

The human readable name of the service
   (example: 'My service.') [] Superfly

Can this service run multiple instances (yes/no) [no] ? no
...

You can validate the XML generated by manifold with the svccfg command. For example: svccfg validate myservice.xml

Once you generate a manifest, you can import it by running:

# svccfg import myservcice.xml

After importing, you will need to enable it with:

# svcadm enable myservice

The reference to "myservice" is the name of the service that you specify when running manifold.

For more information on manifold, see http://code.google.com/p/manifold.