CTRUN(1) | User Commands | CTRUN(1) |
ctrun - execute command in a process contract
/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.
For additional information about process contracts, see contract(5) and process(5).
The following options are supported:
-A fmri aux
-i event,[event ...]
-f event,[event ...]
The following are valid events:
core
core events are informative by default.
empty
exit
fork
hwerr
hwerr events are fatal by default.
signal
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.
-F fmri
-l lifetime
child
contract
none
-o option,[option ...]
noorphan
This option is invalid when a lifetime of none is specified.
pgrponly
regent
-r count
This option is invalid if a lifetime other than contract is specified or if the pgrponly option is used.
-t
This option is invalid unless -r is also specified.
-v
-V
The following operands are supported:
argument
command
Example 1 Running a Shell in a New Process Contract
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:
123
124
125
126
127
/system/contract/process/*
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.
ctstat(1), ctwatch(1), exec(2), contract(5), process(5), attributes(7)
February 25, 2008 | OmniOS |