/usr/bin/ctrun [options] command [ argument]...
The ctrun utility starts a command in a newly created process contract. ctrun holds the contract and can be instructed to output or respond to events that occur within the contract.
The following options are supported:
-A fmri aux
-i event,[event ...]
-f event,[event ...]
The following are valid events:
core events are informative by default.
hwerr events are fatal by default.
Only core, hwerr, and signal events can be made fatal.
More events can be delivered than requested if ctrun requires them for its own purposes. For example, empty messages are always requested if a lifetime of contract is specified. See -l.
-o option,[option ...]
This option is invalid when a lifetime of none is specified.
This option is invalid if a lifetime other than contract is specified or if the pgrponly option is used.
This option is invalid unless -r is also specified.
The following operands are supported:
The following example runs a shell in a new process contract:
example% ctrun -l child -o pgrponly ksh
The -l child option argument is specified so that ctrun won't wait until all children of the shell have exited. -o pgrponly is specified because an interactive ksh puts each job in a new process group, and an error in one job is unlikely to affect the others.
Example 2 Running a Simple Server
The following example runs a simple server:
example% ctrun -r 0 -t -f hwerr,core,signal server
The -r 0 and -t options are specified to indicate that if the server encounters a fatal error, ctrun should try to restart it. The -f option makes "hwerr", "core", and "signal" fatal events.
If command is specified and successfully invoked (see exec(2)), the exit status of ctrun is the exit status of command. Otherwise, ctrun exits with one of the following values:
See attributes(7) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|Interface Stability||See below.|
Human Readable Output is Uncommitted. Invocation is Committed.
|February 25, 2008||OmniOS|