Next: Dependencies, Previous: Top, Up: Top [Contents][Index]
The name pies
(pronounced ‘p-yes’) stands for
‘Program Invocation and Execution Supervisor’. This utility
starts and controls execution of external programs. In this document
these programs will be referred to as components. Each
component is a stand-alone program, which is executed in the
foreground.
Upon startup, pies
reads the list of components
from its configuration file, starts them, and remains in the
background, controlling their execution. Each component is
defined by the name of the external program to be run and its
arguments (command line). The program is normally run directly
(via exec
), but you can instruct pies
to run
it via sh -c
as well.
The standard output and standard error streams of a component can be
redirected to a file or to an arbitrary syslog
channel.
The way of handling each component, and in particular the action to be taken upon its termination is determined by the component’s mode.
A respawn component is restarted each time it terminates. If
it terminates too often, pies
puts it to sleep for certain
time and logs that fact. This prevents badly configured components
from taking too much resources and allows administrator to take
measures in order to fix the situation. More specific action can
be configured, depending on the exit code of the component.
An inetd-style components is not started. Instead, pies
opens a socket associated with it and listens for connections on that
socket. When a connection arrives, pies
runs this component
to handle it. The connection is bound to the component’s ‘stdin’
and ‘stdout’ streams. The ‘stderr’ stream can be redirected
to a file or to syslog, as described above. This mode of operation is
similar to that of the inetd
utility.
Yet another type of components supported by pies
are
pass-style or meta1-style components. As the name
suggests, this type is designed expressly as a support for
MeTA11 components, namely
smtps
. This type can be regarded as a mixture of the above
two. For each meta1-style component pies
opens a socket
and starts the component executable program. Once the program
is running, pies
passes it the file descriptor of that
socket, through another preconfigured UNIX-style socket. Further
handling of the socket is the responsibility of the program itself.
An accept component is basically handled as ‘inetd’,
except that after binding to the socket pies
immediately
starts the program, without waiting for actual connections.
Finally, two special component modes are available. Startup
components are run right after pies
startup, prior to
running any other components. Their counterpart, shutdown
components are run before program termination, after all other
components have finished.
Any number of components of all types can be handled simultaneously.
Components are started in the order of their appearance in the configuration file and terminated in reverse order. This order can be modified by declaring component prerequisites or dependents. This is described in the following chapter.
As an exception, this order is reversed for the components read from
MeTA1 configuration files, either included by include-meta1
statement (see include-meta1) or expressly supplied in the command
line (see config syntax).
Next: Dependencies, Previous: Top, Up: Top [Contents][Index]