\input texinfo @c -*-texinfo-*- @smallbook @c %**start of header @setfilename pies.info @settitle GNU Pies Manual @c %**end of header @setchapternewpage odd @defcodeindex pr @defcodeindex op @c mt is the same as op, but used for mtasim options. @defcodeindex mt @defcodeindex kw @defcodeindex fl @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp @syncodeindex mt cp @syncodeindex pg cp @syncodeindex tp cp @syncodeindex op cp @syncodeindex pr cp @syncodeindex kw cp @syncodeindex fl cp @include version.texi @include rendition.texi @include macros.texi @ifinfo @dircategory System Administration @direntry * GNU Pies: (pies). Program Invocation and Execution Supervisor. * pies: (pies) Invocation. GNU Pies Command Line Options. @end direntry @end ifinfo @copying Published by the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Copyright @copyright{} 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being ``GNU Pies Manual'', and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled ``GNU Free Documentation License''. (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.'' @end copying @titlepage @title The @sc{GNU PIES} Manual @subtitle version @value{VERSION}, @value{UPDATED} @author Sergey Poznyakoff. @page @vskip 0pt plus 1filll @insertcopying @end titlepage @ifnothtml @page @summarycontents @end ifnothtml @page @contents @ifnottex @node Top @top GNU Pies Manual This edition of the @cite{GNU Pies Manual}, last updated @value{UPDATED}, documents @command{pies} Version @value{VERSION}. @end ifnottex @menu * Intro:: * Pies Configuration File:: * Pies Debugging:: * Configuration Example:: * Command Line Usage:: * Invocation:: * Reporting Bugs:: Appendices * User-Group ACLs:: * Copying This Manual:: The GNU Free Documentation License. * Concept Index:: Index of Concepts. @detailmenu --- The Detailed Node Listing --- Pies Configuration File * Syntax:: Configuration File Syntax * Component Statement:: * Notification:: Mail Notification * ACL:: Access Control Lists * include-meta1:: * Global Configuration:: Configuration File Syntax * Comments:: * Statements:: * Preprocessor:: Using preprocessor to improve the configuration. Component Statement * Prerequisites:: * Component Privileges:: * Resources:: * Actions Before Startup:: * Exit Actions:: * Output Redirectors:: * Inetd-Style Components:: * Meta1-Style Components:: * Component Syntax Summary:: Global Configuration * Less Useful Statements:: Configuration Example * Simple Pies:: * Hairy Pies:: * Inetd Pies:: @end detailmenu @end menu @node Intro @chapter Introduction @cindex component The name @command{pies} (pronounced @samp{p-yes}) stands for @samp{Program Invocation and Execution Supervisor}. This utility starts and controls execution of external programs, called @dfn{components}. Each component is a stand-alone program, which is executed in the foreground. Upon startup, @command{pies} reads the list of components from its configuration file, starts them, and remains in the background, controlling their execution. When any of the components terminates, @command{pies} restarts it. Its configuration allows to specify actions other than simple restart, depending on the exit code of the component. @cindex prerequisite @cindex dependency @cindex dependents @anchor{component prerequisite} A component @samp{A} may depend on another components, say @samp{B} and @samp{C}, i.e. require them to be running at the moment of its startup. Components @samp{B} and @samp{C} are called @dfn{prerequisites} for @samp{A}, while @samp{A} is called a @dfn{dependency} or @dfn{dependent} component of @samp{B}, @samp{C}. Before restarting any component, @command{pies} verifies if it is a prerequisite for any other components. If so, it first terminates its dependencies, then restarts the component, and then starts its dependencies again, in the order of their appearance in the configuration file. The standard output and standard error streams of a component can be redirected to a file or to an arbitrary @command{syslog} channel. @anchor{init-style} @cindex init-style components This way of operation applies to the @dfn{init-style} components, called so because of the similarity with the @command{init} process manager. @command{Pies} is also able to handle components that receive input on their @samp{stdin} and send reply to @samp{stdout}. Such components are called @dfn{inetd-style} components. @anchor{inetd-style} @cindex inetd-style components Inetd-style components are not executed right after @command{pies} startup. Instead, @command{pies} opens a socket for each of them and listens for connections on these sockets. When a connection arrives, it decides what component the socket corresponds to, and invokes this component to handle that connection. In this case, the connection is bound to component's @samp{stdin} and @samp{stdout} streams. The @samp{stderr} stream can be redirected to a file or to syslog, as described above. This mode of operation is similar to that of the @command{inetd} utility. @anchor{meta1-style} @cindex meta1-style components @cindex smtps Third type of components supported by @command{pies} are @dfn{meta1-style} components. As its name suggests, this type is designed expressly as a support for MeTA1@footnote{See @uref{http://www.meta1.org}} components, namely @command{smtps}. This type can be regarded as a mixture of the above two. For each meta1-style component @command{pies} opens a socket after start-up, and then executes the component. Once the component is running, @command{pies} passes it the file descriptor of that socket, through another preconfigured @acronym{UNIX}-style socket. Further handling of the socket is the responsibility of the component itself. @anchor{accept-style} @cindex accept-style components The last flavor of @command{pies} components are @dfn{accept-style} components, which are handled basically as @samp{inetd-style} ones, except that after binding to the socket @command{pies} immediately starts the component, without waiting for an actual connection. Any number of components of all three styles can be handled simultaneously. Components are started in the order of their appearance in the configuration file and terminated in the reverse order. The same ordering applies when starting or stopping a component dependencies, As an exception, this order is reversed for the components read from files included by @code{include-meta1} statement (@pxref{include-meta1}). @node Pies Configuration File @chapter Pies Configuration File @cindex configuration file @flindex pies.conf @xopindex{config-file, introduced} @command{Pies} reads its settings and component definitions from the @dfn{configuration file} @file{pies.conf}, located in the @dfn{system configuration directory} (in most cases @file{/etc} or @file{/usr/local/etc}, depending on how the package was compiled). An alternative location may be specified using @option{--config-file} (@option{-c} command line option). If any errors are encountered in the configuration file, the program reports them on the standard error and exits with status 78. @xopindex{lint, introduced} To test the configuration file without actually starting the server, the @option{--lint} (@option{-t}) command line option is provided. It causes @command{pies} to check its configuration file and exit with status 0 if no errors were detected, and with status 78 otherwise. @cindex @option{-E}, introduced Before parsing, configuration file is preprocessed using @command{m4} (@pxref{Preprocessor}). To see the preprocessed configuration without actually parsing it, use @option{-E} command line option. @xopindex{config-help, introduced} The rest of this section describes the configuration file syntax in detail. You can receive a concise summary of all configuration directives any time by running @command{pies --config-help}. @menu * Syntax:: Configuration File Syntax * Component Statement:: * Notification:: Mail Notification * ACL:: Access Control Lists * include-meta1:: * Global Configuration:: @end menu @node Syntax @section Configuration File Syntax The configuration file consists of statements and comments. There are three classes of lexical tokens: keywords, values, and separators. Blanks, tabs, newlines and comments, collectively called @dfn{white space} are ignored except as they serve to separate tokens. Some white space is required to separate otherwise adjacent keywords and values. @menu * Comments:: * Statements:: * Preprocessor:: Using preprocessor to improve the configuration. @end menu @node Comments @subsection Comments @cindex Comments in a configuration file @cindex single-line comments @dfn{Comments} may appear anywhere where white space may appear in the configuration file. There are two kinds of comments: single-line and multi-line comments. @dfn{Single-line} comments start with @samp{#} or @samp{//} and continue to the end of the line: @smallexample # This is a comment // This too is a comment @end smallexample @cindex multi-line comments @dfn{Multi-line} or @dfn{C-style} comments start with the two characters @samp{/*} (slash, star) and continue until the first occurrence of @samp{*/} (star, slash). Multi-line comments cannot be nested. @node Statements @subsection Statements @cindex statements, configuration file @cindex configuration file statements @cindex statement, simple @cindex simple statements A @dfn{simple statement} consists of a keyword and value separated by any amount of whitespace. The simple statement is terminated with a semicolon (@samp{;}), unless it contains a @dfn{here-document} (see below), in which case the semicolon is optional. Examples of simple statements are: @smallexample pidfile /var/run/pies.pid; source-info yes; debug 10; @end smallexample A @dfn{keyword} begins with a letter and may contain letters, decimal digits, underscores (@samp{_}) and dashes (@samp{-}). Examples of keywords are: @samp{group}, @samp{control-file}. A @dfn{value} can be one of the following: @table @asis @item number A number is a sequence of decimal digits. @item boolean @cindex boolean value A boolean value is one of the following: @samp{yes}, @samp{true}, @samp{t} or @samp{1}, meaning @dfn{true}, and @samp{no}, @samp{false}, @samp{nil}, @samp{0} meaning @dfn{false}. @item unquoted string @cindex string, unquoted An unquoted string may contain letters, digits, and any of the following characters: @samp{_}, @samp{-}, @samp{.}, @samp{/}, @samp{:}. @item quoted string @cindex quoted string @cindex string, quoted @cindex escape sequence A quoted string is any sequence of characters enclosed in double-quotes (@samp{"}). A backslash appearing within a quoted string introduces an @dfn{escape sequence}, which is replaced with a single character according to the following rules: @float Table, backslash-interpretation @caption{Backslash escapes} @multitable @columnfractions 0.30 .5 @headitem Sequence @tab Replaced with @item \a @tab Audible bell character (@acronym{ASCII} 7) @item \b @tab Backspace character (@acronym{ASCII} 8) @item \f @tab Form-feed character (@acronym{ASCII} 12) @item \n @tab Newline character (@acronym{ASCII} 10) @item \r @tab Carriage return character (@acronym{ASCII} 13) @item \t @tab Horizontal tabulation character (@acronym{ASCII} 9) @item \v @tab Vertical tabulation character (@acronym{ASCII} 11) @item \\ @tab A single backslash (@samp{\}) @item \" @tab A double-quote. @end multitable @end float In addition, any occurrence of @samp{\} immediately followed by a newline character (@acronym{ASCII} 10) is removed from the string. This allows to split long strings over several physical lines, e.g.: @smallexample @group "a long string may be\ split over several lines" @end group @end smallexample If the character following a backslash is not one of those specified above, the backslash is ignored and a warning is issued. Two or more adjacent quoted strings are concatenated, which gives another way to split long strings over several lines to improve readability. The following fragment produces the same result as in the example above: @smallexample @group "a long string may be" " split over several lines" @end group @end smallexample @anchor{here-document} @item Here-document @cindex here-document @dfn{Here-document} is a special construct that allows to introduce strings of text containing embedded newlines. The @code{<<@var{word}} construct instructs the parser to read all the following lines up to the line containing only @var{word}, with possible trailing blanks. Any lines thus read are concatenated together into a single string. For example: @smallexample @group <}). @end deffn @deffn {Config: return-code} message @var{string} Supply the email message text to be sent. @var{String} must be a valid RFC 822 message, i.e. it must begin with message headers, followed by an empty line and the actual message body. The message may contain variable data in the form of variable references. A @dfn{variable} is an entity that holds some data describing the event that occurred. Meta-variables are referenced using the following construct: @smallexample $@{@var{name}@} @end smallexample @noindent where @var{name} is the name of the variable. Before actually sending the message, each occurrence of this construct is removed from the text and replaced by the actual value of the referenced variable. For example, the variables @samp{component} and @samp{retcode} expand to the name of the exited component and its exit code, correspondingly. Supposing that @samp{component} is @samp{ftpd} and @samp{retcode} is 76, the following fragment: @smallexample Subject: $@{component@} exited with code $@{retcode@} @end smallexample @noindent will become: @smallexample Subject: ftpd exited with code 76 @end smallexample The table below lists all available variables and their expansions: @float Table, notification-variables @caption{Notification Variables} @multitable @columnfractions 0.5 0.5 @headitem Variable @tab Expansion @item canonical-program-name @tab @samp{pies} @item program-name @tab Program name of the @command{pies} binary. @item package @tab Package name (@samp{Pies}). @item version @tab Package version (@value{VERSION}). @item component @tab Name of the terminated component. @item termination @tab Termination cause (see below). @item retcode @tab Component exit code (or signal number, if exited on signal), in decimal. @end multitable @end float The @samp{termination} variable is set so as to facilitate its use with the @samp{retcode} variable. Namely, its value is @samp{exited with}, if the component exited and @samp{terminated on signal}, if it terminated on a signal. Thus, using @smallexample $@{termination@} $@{retcode@} @end smallexample @noindent results in a correct English sentence. This message, however, cannot be properly internationalized. This will be fixed in the future versions. If @code{message} statement is not given, the following default message is used instead: @smallexample From: <> X-Agent: $@{canonical-program-name@} ($@{package@} $@{version@}) Subject: Component $@{component@} $@{termination@} $@{retcode@}. @end smallexample @end deffn @cindex mailer @cindex @command{sendmail} Notification messages are sent using an external program, called @dfn{mailer}. By default it is @command{/usr/sbin/sendmail}. You can change it using the following configuration statement: @deffn {Config} mailer-program @var{prog} Use @var{prog} as a mailer program. The mailer must meet the following requirements: @enumerate 1 @item It must read the message from its standard input. @item It must treat the non-optional arguments in its command line as recipient addresses. @end enumerate For example, the following statement instructs @command{pies} to use @command{exim} as a mailer: @smallexample mailer-program /usr/sbin/exim; @end smallexample @end deffn By default, the mailer program is invoked as follows: @smallexample /usr/sbin/sendmail -oi -t @var{rcpts} @end smallexample @noindent where @var{rcpts} is a whitespace-separated list of addresses supplied in the @samp{notify} statement. The mailer command may be altered using @samp{mailer-command-line} statement: @deffn {Config} mailer-command-line @var{string} Set mailer command line. Notice, that @var{string} must include the command name as well. The @samp{mailer-program} statement supplies the full name of the binary which will be executed, while the first word from the @samp{mailer-command-line} argument gives the string it receives as @samp{argv[0]}. The example below shows how to use this statement to alter the envelope sender address: @smallexample mailer-command-line "sendmail -f root@@domain.com -oi -t"; @end smallexample @end deffn @node ACL @section Access Control Lists @cindex @acronym{ACL} @cindex access control lists @dfn{Access control lists}, or @acronym{ACL}s for short, are lists of permissions that control access to @samp{inetd}, @samp{access} and @samp{meta1}-style components. An @acronym{ACL} is defined using @code{acl} block statement: @deffn {Config} acl @smallexample acl @{ @var{definitions} @} @end smallexample @end deffn This statement is allowed both in global context and within a @samp{component} block. If both are present, the global-level @acronym{ACL} is consulted first, and if it allows access, the component @acronym{ACL} is consulted. As a result, access is granted only if both lists allow it. A @dfn{named @acronym{ACL}} is an access control list which is assigned its own name. Named @acronym{ACL}s are defined using the @samp{defacl} statement: @deffn {Config} defacl @var{name} @smallexample defacl @var{name} @{ @var{definitions} @} @end smallexample The @var{name} parameter specifies a unique name for that @acronym{ACL}. Named @acronym{ACL}s are applied only if referenced from another @acronym{ACL} (either global or a per-component one, or any named @acronym{ACL}, referenced from these). @xref{acl-ref, ACL references}, below. @end deffn In both forms, the part between the curly braces (denoted by @var{definitions}), is a list of @dfn{access control statements}. There are two types of such statements: @deffn {Config: acl} allow [@var{user-group}] @var{sub-acl} @var{host-list} @deffnx {Config: acl} allow any Allow access to the component. @end deffn @ignore @deffn {Config: defacl} allow [@var{user-group}] @var{sub-acl} @var{host-list} @end deffn @end ignore @deffn {Config: acl} deny [@var{user-group}] @var{sub-acl} @var{host-list} @deffnx {Config: acl} deny any Deny access to the component. @end deffn @ignore @deffn {Config: defacl} deny [@var{user-group}] @var{sub-acl} @var{host-list} @end deffn @end ignore All parts of an access statement are optional, but at least one of them must be present. The @var{user-group} part is reserved for future use and is described in more detail in @ref{User-Group ACLs}. @anchor{acl-ref} The @var{sub-acl} part, if present, allows to branch to another @acronym{ACL}. The syntax of this part is: @smallexample acl @var{name} @end smallexample @noindent where @var{name} is the name of an @acronym{ACL} defined previously in @samp{defacl} statement. The @var{host-list} group allows to match client addresses. It consists of the @code{from} keyword followed by a list of @dfn{address specifiers}. Allowed address specifiers are: @table @asis @item @var{addr} Matches if the client @acronym{IP} equals @var{addr}. The latter may be given either as an @acronym{IP} address or as a host name, in which case it will be resolved and the first of its @acronym{IP} addresses will be used. @item @var{addr}/@var{netlen} Matches if first @var{netlen} bits from the client @acronym{IP} address equal to @var{addr}. The network mask length, @var{netlen} must be an integer number in the range from 0 to 32. The address part, @var{addr}, is as described above. @item @var{addr}/@var{netmask} The specifier matches if the result of logical @acronym{AND} between the client @acronym{IP} address and @var{netmask} equals to @var{addr}. The network mask must be specified in ``dotted quad'' form, e.g. @samp{255.255.255.224}. @item @var{filename} Matches if connection was received from a @acronym{UNIX} socket @var{filename}, which must be given as an absolute file name. @end table @anchor{acl-any} The special form @samp{allow any} means to allow access unconditionally. Similarly, @samp{deny any}, denies access unconditionally. Normally, one of these forms appears as the last statement in an @acronym{ACL} definition. To summarize, the syntax of an access statement is: @smallexample allow|deny [acl @var{name}] [from @var{addr-list}] @end smallexample @noindent where square brackets denote optional parts. When an @acronym{ACL} is checked, its entries are tried in turn until one of them matches, or the end of the list is reached. If a matched entry is found, its command verb, @code{allow} or @code{deny}, defines the result of the @acronym{ACL} check. If the end of the list is reached, the result is @samp{allow}, unless explicitly specified otherwise (using the @ref{acl-any, ``any'' form}.) For example, the following @acronym{ACL} allows access for anybody coming from networks @samp{192.168.10.0/24} and @samp{192.168.100.0/24}, or any connection that matches the named @acronym{ACL} @samp{my-nets} (which should have been defined before this definition). Access is denied for anybody else: @smallexample @group acl @{ allow from (192.168.10.0/24, 192.168.100.0/24); allow acl "my-nets"; deny all; @} @end group @end smallexample @node include-meta1 @section Using MeTA1 Configuration File @flindex /etc/meta1/meta1.conf MeTA1 is a mail transfer agent of new generation, designed to replace Sendmail in the future (@uref{http://www.meta1.org}). It has a modular structure, each module being an independent responsible for a particular task. The components are configured in the MeTA1 configuration file @file{/etc/meta1/meta1.conf}. @command{Pies} is able to take a list of components directly from MeTA1 configuration file: @deffn {Config} include-meta1 @var{file} Parse @var{file} as MeTA1 configuration file and incorporate components defined there into the current component list. For example: include-meta1 /etc/meta1/meta1.conf; @end deffn Thus, you can use @command{pies} instead of the default MeTA1 program manager @command{mcp}. This is particularly useful if you use @samp{Mailfromd} (@uref{http://mailfromd.software.gnu.org.ua}) to control the mail flow. To ensure compatibility with MeTA1, the components read from its configuration file are started in the reverse order (i.e. from last to first), and stopped in the order of their appearance in @var{file}. Of course, this does not affect normal @command{pies} components. The following @command{pies} statements are silently applied to all MeTA1 components: @smallexample allgroups yes; stderr file @var{compname}.log chdir @var{queue-dir} @end smallexample Here, @var{compname} stands for the name of the component, and @var{queue-dir} stands for the name of MeTA1 queue directory. The latter is @file{/var/spool/meta1} by default. It can be changed using the following statement: @deffn {Config} meta1-queue-dir @var{dir} Set name of MeTA1 queue directory. @end deffn To override any default settings for a MeTA1 component, add a @code{command} section with the desired settings after including @file{meta1.conf}. For example, here is how to redirect the standard error of the @samp{smtps} component to @samp{local1.debug} syslog channel: @smallexample include-meta1 /etc/meta1/meta1.conf component smtps @{ facility local1; stderr syslog debug; @} @end smallexample @node Global Configuration @section Global Configuration @cindex Global Configuration The statements described in this section affect @command{pies} behavior as a whole. @anchor{syslog} @deffn {Config} syslog @{ ... @} This block statement configures logging via syslog. It has two substatements: @end deffn @deffn {Config: syslog} tag @var{string} Prefix syslog messages with this string. By default, the program name is used. @end deffn @deffn {Config: syslog} facility @var{string} Set syslog facility to use. Allowed values are: @samp{user}, @samp{daemon}, @samp{auth}, @samp{authpriv}, @samp{mail}, @samp{cron}, @samp{local0} through @samp{local7} (case-insensitive), or a facility number. @end deffn @deffn {Config} umask @var{number} Set the default umask. The @var{number} must be an octal value not greater than @samp{777}. The default umask is inherited at startup. @end deffn @deffn {Config} limits @var{arg} Set global system limits for all pies components. @xref{Resources, limits}, for a detailed description of @var{arg}. @end deffn @deffn {Config} return-code @{ ... @} Configure global exit actions. @xref{Exit Actions}, for a detailed description of this statement. @end deffn @deffn {Config} shutdown-timeout @var{number}; Wait @var{number} of seconds for all components to shut down. Default is 5 seconds. @end deffn @menu * Less Useful Statements:: @end menu @node Less Useful Statements @subsection Less Useful Statements Some configuration file statements are provided for completeness and are rarely, if at all used. If used improperly, they may severely impair the functionality of @command{pies} or even render it useless. Do not use them, unless you have a good knowledge of @command{pies} internals and understand their impact. The following three statements define file names of various files needed by @command{pies}. Use them only if the defaults does not suit your needs: @deffn {Config} pidfile @var{file} Write PID of the master @command{pies} process to @var{file}. By default the master PID is stored in @file{@var{localstatedir}/pies.pid}, where @var{localstatedir} is the @dfn{local state directory}, defined at compile time (usually, it is @file{/usr/local/var} or @file{/usr/var}). @end deffn @deffn {Config} control-file @var{file} Set file name of the @command{pies} control file. Default is @file{@var{localstatedir}/pies.ctl} @end deffn @deffn {Config} stat-file @var{file} Set file name of the statistics output file. Default is @file{@var{localstatedir}/pies.stat}. @end deffn Normally, @command{pies} must be run with root privileges. If, however, you found such an implementation for it, that requires another privileges, you may change them using the following three statements: @deffn {Config} user @var{user-name} Start @command{pies} with the UID and GID of this user. @end deffn @deffn {Config} group @var{group-list} Retain the supplementary groups, specified in @var{group-list}. @end deffn @deffn {Config} allgroups @var{bool} Retain all supplementary groups of which user, given with @command{user} statement, is a member. @end deffn @node Pies Debugging @chapter Pies Debugging @xopindex{debug, described} The amount of debugging information produced by @command{pies} is configured by the following statements: @deffn {Config} debug @var{level} Set debugging level. The @var{level} must be a non-negative decimal integer. In version @value{VERSION} the following debugging levels are used: @table @asis @item 1 Log all basic actions: starting and stopping of components, received incoming @acronym{TCP} connections, sending mails. Notify about setting limits. Log pre-startup actions (@pxref{Actions Before Startup}). @item 2 Log setting particular limits. Log the recomputed alarms. @item 4 Dump execution environments @item 6 Debug the parser of MeTA1 configuration grammar. @item 7 Debug the lexical analyzer of MeTA1 configuration file. @end table @end deffn @anchor{source-info} @deffn {Config} source-info @var{bool} This statement decides whether debugging messages should contain source information. To enable source information, use: @smallexample source-info yes; @end smallexample This feature is designed for @command{pies} developers. @end deffn @node Configuration Example @chapter Configuration Example In this section we provide several examples of working @command{pies} configuration files. @menu * Simple Pies:: * Hairy Pies:: * Inetd Pies:: @end menu @node Simple Pies @section Simplest Case: Using Pies to Run Pmult The example below runs @command{pmult} (@pxref{pmult, Pmilter multiplexer program,, mailfromd, Mailfromd Manual}) utility with the privileges of @samp{meta1} user. Both standard error and standard output are redirected to the syslog facility @samp{mail}, priorities @samp{err} and @samp{info}, correspondingly. @smallexample component pmult @{ command "/usr/local/sbin/pmult"; user meta1s; facility mail; stderr syslog err; stdout syslog info; @} @end smallexample @node Hairy Pies @section Using Pies to Run Pmult and MeTA1 The example below is a working configuration file for running @command{pmult} and all components of MeTA1, configured in @file{/etc/meta1/meta1.conf}. The global @code{return-code} statement is used to configure @command{pies} behavior for some exit codes. @smallexample # Sample pies configuration for running pmult and MeTA1 # Special handling for exit codes that mean the program was # incorrectly used or misconfigured. return-code (EX_USAGE, EX_CONFIG) @{ action disable; notify "root"; message <<- EOT From: Pies <> X-Agent: $@{canonical-program-name@} ($@{package@} $@{version@}) Subject: Component $@{component@} disabled. Component "$@{component@}" has terminated with code $@{retcode@}, which means it encountered some configuration problem. I will not restart it automatically. Please fix its configuration and restart it manually at your earliest convenience. To restart, run ``$@{program-name@} -R $@{component@}'' --- Wuff-wuff, Pies EOT; @} component pmult @{ command "/usr/local/sbin/pmult"; user meta1s; stderr syslog err; stdout syslog info; @} include-meta1 "/etc/meta1/meta1.conf"; @end smallexample @node Inetd Pies @section Running Pies Instead of Inetd This configuration file allows to run @command{pies} instead of @command{initd}. It starts two services: @samp{ftp} and @samp{pop3d}, and restricts access to them to two local subnets: @smallexample acl @{ allow from 10.10.10.0/24; allow from 192.168.10.0/27; deny from any; @} debug 3; component ftp @{ mode inetd; socket "inet://0.0.0.0:21"; umask 027; program /usr/sbin/ftpd command "ftpd -l -C"; @} component pop3d @{ mode inetd; socket "inet://0.0.0.0:110"; program "/usr/sbin/pop3d"; command "pop3d --inetd"; @} @end smallexample @node Command Line Usage @chapter Command Line Usage When run without arguments, @command{pies} parses and loads the configuration file, detaches itself from the controlling terminal (becomes a daemon), and starts all components. Before actually starting up, it ensures that no another instance of it is already running, by looking for a PID file and verifying that the PID listed there is alive and responding. If another instance is running, @command{pies} refuses to start up. @anchor{pies-status} After startup, you can verify the status of the running process using @option{--status} command line option: @smallexample @group $ pies --status redirector smtps/stderr 4697 redirector pmult/stderr 4677 redirector pmult/stdout 4676 component pmult 4678 /usr/local/sbin/pmult component smar 4680 smar -f /etc/meta1/meta1.conf -d 100 component qmgr 4691 qmgr -f /etc/meta1/meta1.conf component smtpc 4696 smtpc -f /etc/meta1/meta1.conf component smtps 4698 smtps -d100 -f /etc/meta1/meta1.conf @end group @end smallexample In its output, lines beginning with @samp{component} refer to running components. For running components, the following information is displayed: @enumerate 1 @item Component tag (@pxref{Component Statement}). @item PID of the running instance of the component. @item Command line of the component, as set by the @code{command} statement (@pxref{Component Statement, command}). @end enumerate If the component is not running, the reason is indicated in the PID column, between the square brackets, e.g.: @smallexample component pmult [disabled; scheduled for Mon 01 Dec 2008 20:27:02] /usr/local/sbin/pmult @end smallexample @noindent (the example above is split in two lines for readability). @anchor{pies-restart} @xopindex{restart-component, described} You can restart any component by using the @option{--restart-component} (@option{-R}) option, e.g.: @smallexample $ pies -R pmult smtps @end smallexample @xopindex{stop, described} To stop all running components and shut down @command{pies}, use the @option{--stop} (@option{-S}) command line option: @smallexample $ pies --stop @end smallexample @cindex dependencies @anchor{dump-depmap} @xopindex{dump-depmap option, introduced} Two options are provided for verifying inter-component dependencies. The @option{--dump-depmap} option prints on the standard output the @dfn{dependency map}. This map is a square matrix with rows representing dependents and columns representing prerequisites. An @samp{X} sign is placed on each crossing which corresponds to the actual dependency. For example: @smallexample @group $ pies --dump-depmap Dependency map: 0 1 2 3 4 0 1 2 X 3 X 4 X X Legend: 0: pmult 1: smar 2: qmgr 3: smtpc 4: smtps @end group @end smallexample This example corresponds to the configuration file shown in @ref{Hairy Pies}. To illustrate how to read it, consider the 4th row of the table. According to the legend, number 4 means @samp{smtps} component. There are two @samp{X} marks: in columns 1 and 2. This means that @samp{smtps} depends on @samp{smar} and @samp{qmgr}. @anchor{dump-prereq} @xopindex{dump-prereq, described} You can also list prerequisites explicitly: @smallexample @group $ pies --dump-prereq qmgr: smar smtpc: qmgr smtps: smar qmgr @end group @end smallexample @node Invocation @chapter Pies Invocation This section summarizes @command{pies} command line options. @table @option @opsummary{config-file} @item --config-file=@var{file} @item -c @var{file} Read configuration from @var{file}, instead of the default @file{/etc/pies.conf}. @xref{Pies Configuration File}. @opsummary{config-help} @item --config-help Show configuration file summary. @xref{Pies Configuration File}. @opsummary{define} @item --define=@var{sym}[=@var{value}] @itemx -D @var{symbol}[=@var{value}] Define symbol @var{sym} as having @var{value}, or emtpy, if the @var{value} is not given. @xref{Preprocessor}. @opsummary{debug} @item --debug=@var{level} @itemx -x @var{level} Set debug verbosity level. @xref{Pies Debugging}, for a description of @var{level}. @opsummary{dump-depmap} @item --dump-depmap Dump dependency map. @xref{dump-depmap}. @opsummary{dump-prereq} @item --dump-prereq Dump prerequisite charts. @xref{dump-prereq}. @item -E Preprocess configuration file and exit. @xref{Preprocessor}. @opsummary{force} @item --force Force startup even if another instance may be running. @opsummary{foreground} @item --foreground Remain in foreground. @item --help Display a short usage summary and exit. @opsummary{lint} @item --lint @itemx -t @opsummary{source-info} @item --source-info Show source info with debugging messages. @xref{source-info}. @opsummary{status} @item --status @itemx -s Display info about the running instance. @xref{pies-status}. @opsummary{stderr} @item --stderr Log to standard error. @opsummary{stop} @item --stop @itemx -S Stop the running instance. @opsummary{syslog} @item --syslog Log to syslog. This is the default. @opsummary{reload} @opsummary{hup} @item -r @itemx --reload @itemx --hup Reload the running instance of pies. @opsummary{restart-component} @item -R @itemx --restart-component Restart components named in the command line. @xref{pies-restart}. @item --version Display program version and license information and exit. @xopindex{undefine} @item --undefine=@var{sym} @itemx -U @var{sym} Undefine symbol @var{sym}. @xref{Preprocessor}. @item --usage Display a short summary of available options and exit. @end table @node Reporting Bugs @chapter How to Report a Bug Send bug-reports and suggestions to @email{bug-pies@@gnu.org.ua}. If you think you've found a bug, please be sure to include maximum information needed to reliably reproduce it, or at least to analyze it. The information needed is: @itemize @item Version of the package you are using. @item Compilation options used when configuring the package. @item Run-time configuration (@file{pies.conf} file and the command line options used). @item Detailed description of the bug. @item Conditions under which the bug appears. @end itemize @node User-Group ACLs @appendix User-Group ACLs @include usr-acl.texi @node Copying This Manual @appendix GNU Free Documentation License @include fdl.texi @node Concept Index @unnumbered Concept Index This is a general index of all issues discussed in this manual @printindex cp @bye