added checking of result when building demos
[urisagit/Stem.git] / Design / proc_notes
CommitLineData
4536f655 1Stem::Proc
2
3A major service in network management infrastructure is running and
4controlling processes. Stem::Proc is a very simple to use cell which
5has a wide range of useful options to control the process behavior
6and its standard I/O. The required parameters to the cell specify
7the program and its arguments.
8
9The first group of configuration parameters controls how and when the
10process is actually started. A process can be started at
11configuration time or initiated by a command message. The message
12interface is very important as it allows process management from any
13other cell, including Stem::Cron (this will allow emulation of the OS
14cron running processes), Stem::SockMsg (this will allow emulation
15of the OS inetd), and other similar needs for remote process
16invocation. Process monitoring is achieved by handling SIGCHLD
17signals and I/O handle shut-down detection. A message can be sent
18upon process exiting and the process can optionally be restarted
19automatically, giving you a watchdog service.
20
21The second group is much larger and controls the I/O behavior of the
22process. You can enable/disable any subset of its
23stdin/stdout/stderr handles. This is needed for processes that don't
24use all of their standard I/O handles. Process I/O can be managed by
25the Stem::AsyncIO class and callbacks. In addition, the cell can be
26configured to transfer its I/O data to/from other cells via Stem
27messages. One neat feature is the ability to buffer all output from
28a process and send it via a message only upon process exit. This
29emulates the running of a process in backquotes as supported by
30shells and Perl.
31
32Processes that need to work with a terminal can optionally be run
33behind a pseudo-TTY device.
34