summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--doc/pies.texi290
-rw-r--r--src/comp.c10
-rw-r--r--src/meta1parse.c4
3 files changed, 178 insertions, 126 deletions
diff --git a/doc/pies.texi b/doc/pies.texi
index 51eac43..13deec0 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -1,5 +1,4 @@
1\input texinfo @c -*-texinfo-*- 1\input texinfo @c -*-texinfo-*-
2@smallbook
3@c %**start of header 2@c %**start of header
4@setfilename pies.info 3@setfilename pies.info
5@settitle GNU Pies Manual 4@settitle GNU Pies Manual
@@ -251,9 +250,9 @@ this format, the program also understands configuration files in
251 Alternative configuration files may be specified using @option{--config-file} 250 Alternative configuration files may be specified using @option{--config-file}
252(@option{-c} command line option), e.g.: 251(@option{-c} command line option), e.g.:
253 252
254@smallexample 253@example
255pies --config-file @var{filename} 254pies --config-file @var{filename}
256@end smallexample 255@end example
257 256
258@anchor{config syntax} 257@anchor{config syntax}
259Any number of such options may be given. The files named in 258Any number of such options may be given. The files named in
@@ -286,13 +285,13 @@ the end of the command line or the next occurrence of the
286@command{pies} to read several configuration files of various formats 285@command{pies} to read several configuration files of various formats
287in a single command line, e.g.: 286in a single command line, e.g.:
288 287
289@smallexample 288@example
290@group 289@group
291pies --config-file /etc/pies.conf \ 290pies --config-file /etc/pies.conf \
292 --syntax=inetd --config-file /etc/inetd.conf \ 291 --syntax=inetd --config-file /etc/inetd.conf \
293 --syntax=meta1 --config-file /etc/meta1/meta1.conf 292 --syntax=meta1 --config-file /etc/meta1/meta1.conf
294@end group 293@end group
295@end smallexample 294@end example
296 295
297@xopindex{config-help, introduced} 296@xopindex{config-help, introduced}
298 The rest of this chapter concerns the @command{pies} native 297 The rest of this chapter concerns the @command{pies} native
@@ -321,10 +320,11 @@ line option.
321@menu 320@menu
322* Syntax:: Configuration File Syntax 321* Syntax:: Configuration File Syntax
323* Component Statement:: 322* Component Statement::
324* Notification:: Mail Notification 323* Notification:: Mail Notification.
325* ACL:: Access Control Lists 324* ACL:: Access Control Lists.
326* inetd:: Using @command{inetd} Configuration Files 325* control:: The @samp{control} statement.
327* include-meta1:: Using @command{meta1} Configuration Files 326* inetd:: Using @command{inetd} Configuration Files.
327* include-meta1:: Using @command{meta1} Configuration Files.
328* Global Configuration:: 328* Global Configuration::
329* Pies Privileges:: 329* Pies Privileges::
330* State Files:: 330* State Files::
@@ -355,10 +355,10 @@ configuration file. There are two kinds of comments:
355single-line and multi-line comments. @dfn{Single-line} comments start 355single-line and multi-line comments. @dfn{Single-line} comments start
356with @samp{#} or @samp{//} and continue to the end of the line: 356with @samp{#} or @samp{//} and continue to the end of the line:
357 357
358@smallexample 358@example
359# This is a comment 359# This is a comment
360// This too is a comment 360// This too is a comment
361@end smallexample 361@end example
362 362
363The following constructs, appearing at the start of a line are 363The following constructs, appearing at the start of a line are
364treated specially: @samp{#include}, @samp{#include_once}, 364treated specially: @samp{#include}, @samp{#include_once},
@@ -384,11 +384,11 @@ with a semicolon (@samp{;}).
384 384
385 Examples of simple statements are: 385 Examples of simple statements are:
386 386
387@smallexample 387@example
388pidfile /var/run/pies.pid; 388pidfile /var/run/pies.pid;
389source-info yes; 389source-info yes;
390debug 10; 390debug 10;
391@end smallexample 391@end example
392 392
393 A @dfn{keyword} begins with a letter and may contain letters, 393 A @dfn{keyword} begins with a letter and may contain letters,
394decimal digits, underscores (@samp{_}) and dashes (@samp{-}). 394decimal digits, underscores (@samp{_}) and dashes (@samp{-}).
@@ -442,12 +442,12 @@ a newline character (@acronym{ASCII} 10) is removed from
442the string. This allows to split long strings over several 442the string. This allows to split long strings over several
443physical lines, e.g.: 443physical lines, e.g.:
444 444
445@smallexample 445@example
446@group 446@group
447"a long string may be\ 447"a long string may be\
448 split over several lines" 448 split over several lines"
449@end group 449@end group
450@end smallexample 450@end example
451 451
452 If the character following a backslash is not one of those specified 452 If the character following a backslash is not one of those specified
453above, the backslash is ignored and a warning is issued. 453above, the backslash is ignored and a warning is issued.
@@ -457,12 +457,12 @@ another way to split long strings over several lines to improve
457readability. The following fragment produces the same result as in the 457readability. The following fragment produces the same result as in the
458example above: 458example above:
459 459
460@smallexample 460@example
461@group 461@group
462"a long string may be" 462"a long string may be"
463" split over several lines" 463" split over several lines"
464@end group 464@end group
465@end smallexample 465@end example
466 466
467@anchor{here-document} 467@anchor{here-document}
468@item Here-document 468@item Here-document
@@ -475,14 +475,14 @@ the following lines up to the line containing only @var{word}, with
475possible trailing blanks. Any lines thus read are concatenated 475possible trailing blanks. Any lines thus read are concatenated
476together into a single string. For example: 476together into a single string. For example:
477 477
478@smallexample 478@example
479@group 479@group
480<<EOT 480<<EOT
481A multiline 481A multiline
482string 482string
483EOT 483EOT
484@end group 484@end group
485@end smallexample 485@end example
486 486
487 Body of a here-document is interpreted the same way as 487 Body of a here-document is interpreted the same way as
488double-quoted string, unless @var{word} is preceded by a backslash 488double-quoted string, unless @var{word} is preceded by a backslash
@@ -495,14 +495,14 @@ tab characters are stripped from input lines and the line containing
495all leading whitespace is stripped from them. This allows to indent 495all leading whitespace is stripped from them. This allows to indent
496here-documents in a natural fashion. For example: 496here-documents in a natural fashion. For example:
497 497
498@smallexample 498@example
499@group 499@group
500<<- TEXT 500<<- TEXT
501 All leading whitespace will be 501 All leading whitespace will be
502 ignored when reading these lines. 502 ignored when reading these lines.
503TEXT 503TEXT
504@end group 504@end group
505@end smallexample 505@end example
506 506
507 It is important that the terminating delimiter be the only token on 507 It is important that the terminating delimiter be the only token on
508its line. The only exception to this rule is allowed if a 508its line. The only exception to this rule is allowed if a
@@ -510,11 +510,11 @@ here-document appears as the last element of a statement. In this
510case a semicolon can be placed on the same line with its terminating 510case a semicolon can be placed on the same line with its terminating
511delimiter, as in: 511delimiter, as in:
512 512
513@smallexample 513@example
514help-text <<-EOT 514help-text <<-EOT
515 A sample help text. 515 A sample help text.
516EOT; 516EOT;
517@end smallexample 517@end example
518 518
519@item list 519@item list
520@cindex list 520@cindex list
@@ -522,9 +522,9 @@ EOT;
522delimited by parentheses. The following example shows a statement 522delimited by parentheses. The following example shows a statement
523whose value is a list of strings: 523whose value is a list of strings:
524 524
525@smallexample 525@example
526dependents (pmult, auth); 526dependents (pmult, auth);
527@end smallexample 527@end example
528 528
529 In any case where a list is appropriate, a single value is allowed 529 In any case where a list is appropriate, a single value is allowed
530without being a member of a list: it is equivalent to a list with a 530without being a member of a list: it is equivalent to a list with a
@@ -540,13 +540,13 @@ statements. It consists of a keyword, followed by an optional value,
540and a sequence of statements enclosed in curly braces, as shown in 540and a sequence of statements enclosed in curly braces, as shown in
541the example below: 541the example below:
542 542
543@smallexample 543@example
544@group 544@group
545component multiplexor @{ 545component multiplexor @{
546 command "pmult"; 546 command "pmult";
547@} 547@}
548@end group 548@end group
549@end smallexample 549@end example
550 550
551 The closing curly brace may be followed by a semicolon, although 551 The closing curly brace may be followed by a semicolon, although
552this is not required. 552this is not required.
@@ -684,11 +684,11 @@ compatibility with the @sc{c} preprocessor.
684 The @code{component} statement defines a new component: 684 The @code{component} statement defines a new component:
685@end deffn 685@end deffn
686 686
687@smallexample 687@example
688component @var{tag} @{ 688component @var{tag} @{
689 @dots{} 689 @dots{}
690@} 690@}
691@end smallexample 691@end example
692 692
693The component is identified by its @dfn{tag}, which is given as 693The component is identified by its @dfn{tag}, which is given as
694argument to the @code{component} keyword. Component declarations with 694argument to the @code{component} keyword. Component declarations with
@@ -960,9 +960,9 @@ utility:
960 960
961For example: 961For example:
962 962
963@smallexample 963@example
964limits T10 R20 U16 P20 964limits T10 R20 U16 P20
965@end smallexample 965@end example
966 966
967Additionally, the command letter @samp{L} is recognized. It is 967Additionally, the command letter @samp{L} is recognized. It is
968reserved for future use (@samp{number of logins} limit) and is ignored 968reserved for future use (@samp{number of logins} limit) and is ignored
@@ -1005,9 +1005,9 @@ begins with a punctuation character, this character is removed from it
1005before the assignment. This is convenient for using this construct with 1005before the assignment. This is convenient for using this construct with
1006environment variables like @env{PATH}, e.g.: 1006environment variables like @env{PATH}, e.g.:
1007 1007
1008@smallexample 1008@example
1009PATH+=:/sbin 1009PATH+=:/sbin
1010@end smallexample 1010@end example
1011 1011
1012In this example, if @env{PATH} exists, @samp{:/sbin} will be appended 1012In this example, if @env{PATH} exists, @samp{:/sbin} will be appended
1013to it. Otherwise, it will be created and @samp{/sbin} will be 1013to it. Otherwise, it will be created and @samp{/sbin} will be
@@ -1061,11 +1061,11 @@ to the log file. This behavior can be modified using
1061@code{return-code} statement: 1061@code{return-code} statement:
1062 1062
1063@deffn {Config: component} return-code 1063@deffn {Config: component} return-code
1064@smallexample 1064@example
1065return-code @var{codes} @{ 1065return-code @var{codes} @{
1066 @dots{} 1066 @dots{}
1067@} 1067@}
1068@end smallexample 1068@end example
1069@end deffn 1069@end deffn
1070 1070
1071 The @var{codes} argument is a list of exit codes or signal names. 1071 The @var{codes} argument is a list of exit codes or signal names.
@@ -1181,9 +1181,9 @@ The type of redirection is specified by @var{type} argument:
1181Redirect to a file. In this case @var{channel} gives the full name of 1181Redirect to a file. In this case @var{channel} gives the full name of
1182the file. For example: 1182the file. For example:
1183 1183
1184@smallexample 1184@example
1185stderr file /var/log/component/name.err; 1185stderr file /var/log/component/name.err;
1186@end smallexample 1186@end example
1187 1187
1188@item syslog 1188@item syslog
1189Redirect to a syslog channel. The syslog priority is given by the 1189Redirect to a syslog channel. The syslog priority is given by the
@@ -1195,9 +1195,9 @@ statement (see below), if given.
1195 1195
1196Example: 1196Example:
1197 1197
1198@smallexample 1198@example
1199stderr syslog err; 1199stderr syslog err;
1200@end smallexample 1200@end example
1201@end table 1201@end table
1202@end deffn 1202@end deffn
1203 1203
@@ -1255,10 +1255,10 @@ and @samp{777}).
1255 1255
1256For example: 1256For example:
1257 1257
1258@smallexample 1258@example
1259socket 1259socket
1260 "unix:///var/run/socket;user=nobody;group=mail;mode=770"; 1260 "unix:///var/run/socket;user=nobody;group=mail;mode=770";
1261@end smallexample 1261@end example
1262 1262
1263The @var{file} part may be a relative file name, 1263The @var{file} part may be a relative file name,
1264provided that the @code{chdir} statement is used for this component 1264provided that the @code{chdir} statement is used for this component
@@ -1382,7 +1382,7 @@ listed in the above table.
1382 For example, the following component declaration defines a standard 1382 For example, the following component declaration defines a standard
1383TCP-based echo service: 1383TCP-based echo service:
1384 1384
1385@smallexample 1385@example
1386@group 1386@group
1387component echo @{ 1387component echo @{
1388 socket "inet://0.0.0.0:echo"; 1388 socket "inet://0.0.0.0:echo";
@@ -1390,13 +1390,13 @@ component echo @{
1390 flags internal; 1390 flags internal;
1391@} 1391@}
1392@end group 1392@end group
1393@end smallexample 1393@end example
1394 1394
1395 It corresponds to the following @file{inetd.conf} line: 1395 It corresponds to the following @file{inetd.conf} line:
1396 1396
1397@smallexample 1397@example
1398echo stream tcp nowait root internal 1398echo stream tcp nowait root internal
1399@end smallexample 1399@end example
1400 1400
1401 Another built-in services are defined in the same manner, replacing 1401 Another built-in services are defined in the same manner, replacing
1402@samp{echo} in the @code{service} field with the corresponding service 1402@samp{echo} in the @code{service} field with the corresponding service
@@ -1446,13 +1446,13 @@ subordinate services, one name per line, and closes the connection.
1446 The master TCPMUX service is declared as a usual built-in service, 1446 The master TCPMUX service is declared as a usual built-in service,
1447e.g.: 1447e.g.:
1448 1448
1449@smallexample 1449@example
1450component tcpmux-master @{ 1450component tcpmux-master @{
1451 socket "inet://0.0.0.0:1"; 1451 socket "inet://0.0.0.0:1";
1452 service tcpmux; 1452 service tcpmux;
1453 flags internal; 1453 flags internal;
1454@} 1454@}
1455@end smallexample 1455@end example
1456 1456
1457 Any number of subordinate services may be defined for each master. 1457 Any number of subordinate services may be defined for each master.
1458A subordinate server component definition must contain at least the 1458A subordinate server component definition must contain at least the
@@ -1488,14 +1488,14 @@ The command line for handling this service.
1488 1488
1489 For example: 1489 For example:
1490 1490
1491@smallexample 1491@example
1492component scp-to @{ 1492component scp-to @{
1493 service scp-to; 1493 service scp-to;
1494 flags (tcpmuxplus, sockenv); 1494 flags (tcpmuxplus, sockenv);
1495 tcpmux-master tcpmux; 1495 tcpmux-master tcpmux;
1496 command "/usr/sbin/in.wydawca"; 1496 command "/usr/sbin/in.wydawca";
1497@} 1497@}
1498@end smallexample 1498@end example
1499 1499
1500@cindex ACL in TCPMUX services 1500@cindex ACL in TCPMUX services
1501 For TCPMUX services, access control lists are handled in the 1501 For TCPMUX services, access control lists are handled in the
@@ -1563,7 +1563,7 @@ the following configuration snippet configures an @acronym{FTP} server
1563and ensures that a special program is invoked after closing each 1563and ensures that a special program is invoked after closing each
1564@acronym{FTP} connection: 1564@acronym{FTP} connection:
1565 1565
1566@smallexample 1566@example
1567component ftp @{ 1567component ftp @{
1568 return-code EX_OK @{ 1568 return-code EX_OK @{
1569 exec "/sbin/sweeper --log"; 1569 exec "/sbin/sweeper --log";
@@ -1574,7 +1574,7 @@ component ftp @{
1574 program /usr/sbin/in.ftpd 1574 program /usr/sbin/in.ftpd
1575 command "ftpd -ll -C -t180"; 1575 command "ftpd -ll -C -t180";
1576@} 1576@}
1577@end smallexample 1577@end example
1578 1578
1579 This approach may be used to process @command{FTP} uploads in real time. 1579 This approach may be used to process @command{FTP} uploads in real time.
1580 1580
@@ -1602,7 +1602,7 @@ upon its startup.
1602 This subsection summarizes the @code{component} statements. For each 1602 This subsection summarizes the @code{component} statements. For each
1603statement, a reference to its detailed description is provided. 1603statement, a reference to its detailed description is provided.
1604 1604
1605@smallexample 1605@example
1606component @var{tag} @{ 1606component @var{tag} @{
1607 # @r{Component execution mode.} 1607 # @r{Component execution mode.}
1608 # @xref{Component Statement, mode}. 1608 # @xref{Component Statement, mode}.
@@ -1744,7 +1744,7 @@ component @var{tag} @{
1744 exec @var{command} 1744 exec @var{command}
1745 @} 1745 @}
1746@} 1746@}
1747@end smallexample 1747@end example
1748 1748
1749@node Notification 1749@node Notification
1750@section Notification 1750@section Notification
@@ -1761,9 +1761,9 @@ in a @samp{return-code} block.
1761Send email notification to each address from @var{email-string}. The 1761Send email notification to each address from @var{email-string}. The
1762latter is a comma-separated list of email addresses, e.g.: 1762latter is a comma-separated list of email addresses, e.g.:
1763 1763
1764@smallexample 1764@example
1765notify "root@@localhost,postmaster@@localhost"; 1765notify "root@@localhost,postmaster@@localhost";
1766@end smallexample 1766@end example
1767@end deffn 1767@end deffn
1768 1768
1769@deffn {Config: return-code} message @var{string} 1769@deffn {Config: return-code} message @var{string}
@@ -1776,9 +1776,9 @@ variable references. A @dfn{variable} is an entity that holds
1776some data describing the event that occurred. Meta-variables 1776some data describing the event that occurred. Meta-variables
1777are referenced using the following construct: 1777are referenced using the following construct:
1778 1778
1779@smallexample 1779@example
1780$@{@var{name}@} 1780$@{@var{name}@}
1781@end smallexample 1781@end example
1782 1782
1783@noindent 1783@noindent
1784where @var{name} is the name of the variable. Before actually sending 1784where @var{name} is the name of the variable. Before actually sending
@@ -1789,16 +1789,16 @@ to the name of the exited component and its exit code, correspondingly.
1789Supposing that @samp{component} is @samp{ftpd} and @samp{retcode} is 1789Supposing that @samp{component} is @samp{ftpd} and @samp{retcode} is
179076, the following fragment: 179076, the following fragment:
1791 1791
1792@smallexample 1792@example
1793Subject: $@{component@} exited with code $@{retcode@} 1793Subject: $@{component@} exited with code $@{retcode@}
1794@end smallexample 1794@end example
1795 1795
1796@noindent 1796@noindent
1797will become: 1797will become:
1798 1798
1799@smallexample 1799@example
1800Subject: ftpd exited with code 76 1800Subject: ftpd exited with code 76
1801@end smallexample 1801@end example
1802 1802
1803The table below lists all available variables and their expansions: 1803The table below lists all available variables and their expansions:
1804 1804
@@ -1823,9 +1823,9 @@ with the @samp{retcode} variable. Namely, its value is @samp{exited
1823with}, if the component exited and @samp{terminated on signal}, if it 1823with}, if the component exited and @samp{terminated on signal}, if it
1824terminated on a signal. Thus, using 1824terminated on a signal. Thus, using
1825 1825
1826@smallexample 1826@example
1827$@{termination@} $@{retcode@} 1827$@{termination@} $@{retcode@}
1828@end smallexample 1828@end example
1829 1829
1830@noindent 1830@noindent
1831results in a correct English sentence. This message, however, cannot 1831results in a correct English sentence. This message, however, cannot
@@ -1835,12 +1835,12 @@ versions.
1835If @code{message} statement is not given, the following default 1835If @code{message} statement is not given, the following default
1836message is used instead: 1836message is used instead:
1837 1837
1838@smallexample 1838@example
1839From: <> 1839From: <>
1840X-Agent: $@{canonical_program_name@} ($@{package@} $@{version@}) 1840X-Agent: $@{canonical_program_name@} ($@{package@} $@{version@})
1841Subject: Component $@{component@} $@{termination@} $@{retcode@}. 1841Subject: Component $@{component@} $@{termination@} $@{retcode@}.
1842 1842
1843@end smallexample 1843@end example
1844@end deffn 1844@end deffn
1845 1845
1846@cindex mailer 1846@cindex mailer
@@ -1862,17 +1862,17 @@ recipient addresses.
1862For example, the following statement instructs @command{pies} to use 1862For example, the following statement instructs @command{pies} to use
1863@command{exim} as a mailer: 1863@command{exim} as a mailer:
1864 1864
1865@smallexample 1865@example
1866mailer-program /usr/sbin/exim; 1866mailer-program /usr/sbin/exim;
1867@end smallexample 1867@end example
1868 1868
1869@end deffn 1869@end deffn
1870 1870
1871By default, the mailer program is invoked as follows: 1871By default, the mailer program is invoked as follows:
1872 1872
1873@smallexample 1873@example
1874/usr/sbin/sendmail -oi -t @var{rcpts} 1874/usr/sbin/sendmail -oi -t @var{rcpts}
1875@end smallexample 1875@end example
1876 1876
1877@noindent 1877@noindent
1878where @var{rcpts} is a whitespace-separated list of addresses supplied 1878where @var{rcpts} is a whitespace-separated list of addresses supplied
@@ -1890,9 +1890,9 @@ receives as @samp{argv[0]}.
1890 The example below shows how to use this statement to alter the 1890 The example below shows how to use this statement to alter the
1891envelope sender address: 1891envelope sender address:
1892 1892
1893@smallexample 1893@example
1894mailer-command-line "sendmail -f root@@domain.com -oi -t"; 1894mailer-command-line "sendmail -f root@@domain.com -oi -t";
1895@end smallexample 1895@end example
1896@end deffn 1896@end deffn
1897 1897
1898@node ACL 1898@node ACL
@@ -1906,11 +1906,11 @@ permissions that control access to @samp{inetd}, @samp{accept} and
1906An @acronym{ACL} is defined using @code{acl} block statement: 1906An @acronym{ACL} is defined using @code{acl} block statement:
1907 1907
1908@deffn {Config} acl 1908@deffn {Config} acl
1909@smallexample 1909@example
1910acl @{ 1910acl @{
1911 @var{definitions} 1911 @var{definitions}
1912@} 1912@}
1913@end smallexample 1913@end example
1914@end deffn 1914@end deffn
1915 1915
1916 This statement is allowed both in global context and within a 1916 This statement is allowed both in global context and within a
@@ -1924,11 +1924,11 @@ assigned its own name. Named @acronym{ACL}s are defined using
1924the @samp{defacl} statement: 1924the @samp{defacl} statement:
1925 1925
1926@deffn {Config} defacl @var{name} 1926@deffn {Config} defacl @var{name}
1927@smallexample 1927@example
1928defacl @var{name} @{ 1928defacl @var{name} @{
1929 @var{definitions} 1929 @var{definitions}
1930@} 1930@}
1931@end smallexample 1931@end example
1932 1932
1933 The @var{name} parameter specifies a unique name for that 1933 The @var{name} parameter specifies a unique name for that
1934@acronym{ACL}. Named @acronym{ACL}s are applied only if 1934@acronym{ACL}. Named @acronym{ACL}s are applied only if
@@ -1967,9 +1967,9 @@ future use and is described in more detail in @ref{User-Group ACLs}.
1967The @var{sub-acl} part, if present, allows to branch to another 1967The @var{sub-acl} part, if present, allows to branch to another
1968@acronym{ACL}. The syntax of this part is: 1968@acronym{ACL}. The syntax of this part is:
1969 1969
1970@smallexample 1970@example
1971acl @var{name} 1971acl @var{name}
1972@end smallexample 1972@end example
1973 1973
1974@noindent 1974@noindent
1975where @var{name} is the name of an @acronym{ACL} defined previously in 1975where @var{name} is the name of an @acronym{ACL} defined previously in
@@ -2011,9 +2011,9 @@ statement in an @acronym{ACL} definition.
2011 2011
2012To summarize, the syntax of an access statement is: 2012To summarize, the syntax of an access statement is:
2013 2013
2014@smallexample 2014@example
2015allow|deny [acl @var{name}] [from @var{addr-list}] 2015allow|deny [acl @var{name}] [from @var{addr-list}]
2016@end smallexample 2016@end example
2017 2017
2018@noindent 2018@noindent
2019where square brackets denote optional parts. 2019where square brackets denote optional parts.
@@ -2031,7 +2031,7 @@ or any connection that matches the named @acronym{ACL} @samp{my-nets}
2031(which is defined elsewhere in the configuration file). Access is 2031(which is defined elsewhere in the configuration file). Access is
2032denied for anybody else: 2032denied for anybody else:
2033 2033
2034@smallexample 2034@example
2035@group 2035@group
2036acl @{ 2036acl @{
2037 allow from (192.168.10.0/24, 192.168.100.0/24); 2037 allow from (192.168.10.0/24, 192.168.100.0/24);
@@ -2039,7 +2039,11 @@ acl @{
2039 deny all; 2039 deny all;
2040@} 2040@}
2041@end group 2041@end group
2042@end smallexample 2042@end example
2043
2044@node control
2045@section The Control Statement
2046@WRITEME
2043 2047
2044@node inetd 2048@node inetd
2045@section Using @command{inetd} Configuration Files 2049@section Using @command{inetd} Configuration Files
@@ -2063,38 +2067,38 @@ list of components in order of their appearance.
2063For example, the following statement reads components from the 2067For example, the following statement reads components from the
2064standard @command{inetd} configuration file: 2068standard @command{inetd} configuration file:
2065 2069
2066@smallexample 2070@example
2067include-inetd /etc/inetd.conf; 2071include-inetd /etc/inetd.conf;
2068@end smallexample 2072@end example
2069 2073
2070Any number of @code{include-inetd} may be specified. For example, the 2074Any number of @code{include-inetd} may be specified. For example, the
2071following reads the contents of the @file{/etc/inetd.conf} 2075following reads the contents of the @file{/etc/inetd.conf}
2072configuration file and all files from the @file{/etc/inetd.d} 2076configuration file and all files from the @file{/etc/inetd.d}
2073directory: 2077directory:
2074 2078
2075@smallexample 2079@example
2076include-inetd /etc/inetd.conf; 2080include-inetd /etc/inetd.conf;
2077include-inetd /etc/inetd.d; 2081include-inetd /etc/inetd.d;
2078@end smallexample 2082@end example
2079@end deffn 2083@end deffn
2080 2084
2081 Another way to read @command{inetd} configuration files is to supply 2085 Another way to read @command{inetd} configuration files is to supply
2082them in the command line, like this: 2086them in the command line, like this:
2083 2087
2084@smallexample 2088@example
2085pies --syntax=inetd --config-file /etc/inetd.conf 2089pies --syntax=inetd --config-file /etc/inetd.conf
2086@end smallexample 2090@end example
2087 2091
2088Notice the @option{--syntax} option (@pxref{config syntax}). It 2092Notice the @option{--syntax} option (@pxref{config syntax}). It
2089informs @command{pies} that the following files are in @command{inetd} 2093informs @command{pies} that the following files are in @command{inetd}
2090format. Of course, several configuration file may be given: 2094format. Of course, several configuration file may be given:
2091 2095
2092@smallexample 2096@example
2093@group 2097@group
2094pies --syntax=inetd \ 2098pies --syntax=inetd \
2095 --config-file /etc/inetd.conf --config-file /etc/inetd.d 2099 --config-file /etc/inetd.conf --config-file /etc/inetd.d
2096@end group 2100@end group
2097@end smallexample 2101@end example
2098 2102
2099A special option is provided that instructs @command{pies} to behave 2103A special option is provided that instructs @command{pies} to behave
2100as @command{inetd}: 2104as @command{inetd}:
@@ -2116,9 +2120,9 @@ the system binary of that name.
2116The command line usage of the @command{inetd} wrapper is entirely 2120The command line usage of the @command{inetd} wrapper is entirely
2117compatible with that of the usual @command{inetd} utility, i.e.: 2121compatible with that of the usual @command{inetd} utility, i.e.:
2118 2122
2119@smallexample 2123@example
2120inetd [@var{option}] [@var{config} [@var{config}...]] [-- @var{pies-options}] 2124inetd [@var{option}] [@var{config} [@var{config}...]] [-- @var{pies-options}]
2121@end smallexample 2125@end example
2122 2126
2123Options are: 2127Options are:
2124 2128
@@ -2181,11 +2185,11 @@ first), and stopped in the order of their appearance in @var{file}.
2181The following @command{pies} statements are silently applied to 2185The following @command{pies} statements are silently applied to
2182all MeTA1 components: 2186all MeTA1 components:
2183 2187
2184@smallexample 2188@example
2185allgroups yes; 2189allgroups yes;
2186stderr file @var{compname}.log 2190stderr file @var{compname}.log
2187chdir @var{queue-dir} 2191chdir @var{queue-dir}
2188@end smallexample 2192@end example
2189 2193
2190Here, @var{compname} stands for the name of the component, and 2194Here, @var{compname} stands for the name of the component, and
2191@var{queue-dir} stands for the name of MeTA1 queue directory. The 2195@var{queue-dir} stands for the name of MeTA1 queue directory. The
@@ -2202,14 +2206,14 @@ To override any default settings for a MeTA1 component, add a
2202standard error of the @samp{smtps} component to @samp{local1.debug} 2206standard error of the @samp{smtps} component to @samp{local1.debug}
2203syslog channel: 2207syslog channel:
2204 2208
2205@smallexample 2209@example
2206include-meta1 /etc/meta1/meta1.conf 2210include-meta1 /etc/meta1/meta1.conf
2207 2211
2208component smtps @{ 2212component smtps @{
2209 facility local1; 2213 facility local1;
2210 stderr syslog debug; 2214 stderr syslog debug;
2211@} 2215@}
2212@end smallexample 2216@end example
2213 2217
2214@node Global Configuration 2218@node Global Configuration
2215@section Global Configuration 2219@section Global Configuration
@@ -2355,9 +2359,9 @@ Debug the lexical analyzer of MeTA1 configuration file.
2355This statement decides whether debugging messages should contain 2359This statement decides whether debugging messages should contain
2356source information. To enable source information, use: 2360source information. To enable source information, use:
2357 2361
2358@smallexample 2362@example
2359source-info yes; 2363source-info yes;
2360@end smallexample 2364@end example
2361 2365
2362This feature is designed for @command{pies} developers. 2366This feature is designed for @command{pies} developers.
2363@end deffn 2367@end deffn
@@ -2757,7 +2761,7 @@ the privileges of @samp{meta1} user. Both standard error and standard
2757output are redirected to the syslog facility @samp{mail}, priorities 2761output are redirected to the syslog facility @samp{mail}, priorities
2758@samp{err} and @samp{info}, correspondingly. 2762@samp{err} and @samp{info}, correspondingly.
2759 2763
2760@smallexample 2764@example
2761component pmult @{ 2765component pmult @{
2762 command "/usr/local/sbin/pmult"; 2766 command "/usr/local/sbin/pmult";
2763 user meta1s; 2767 user meta1s;
@@ -2765,7 +2769,7 @@ component pmult @{
2765 stderr syslog err; 2769 stderr syslog err;
2766 stdout syslog info; 2770 stdout syslog info;
2767@} 2771@}
2768@end smallexample 2772@end example
2769 2773
2770@node Hairy Pies 2774@node Hairy Pies
2771@section Using Pies to Run Pmult and MeTA1 2775@section Using Pies to Run Pmult and MeTA1
@@ -2774,7 +2778,7 @@ component pmult @{
2774@file{/etc/meta1/meta1.conf}. The global @code{return-code} statement 2778@file{/etc/meta1/meta1.conf}. The global @code{return-code} statement
2775is used to configure @command{pies} behavior for some exit codes. 2779is used to configure @command{pies} behavior for some exit codes.
2776 2780
2777@smallexample 2781@example
2778# Sample pies configuration for running pmult and MeTA1 2782# Sample pies configuration for running pmult and MeTA1
2779 2783
2780# Special handling for exit codes that mean the program was 2784# Special handling for exit codes that mean the program was
@@ -2807,7 +2811,7 @@ component pmult @{
2807@} 2811@}
2808 2812
2809include-meta1 "/etc/meta1/meta1.conf"; 2813include-meta1 "/etc/meta1/meta1.conf";
2810@end smallexample 2814@end example
2811 2815
2812@node Inetd Pies 2816@node Inetd Pies
2813@section Running Pies as Inetd 2817@section Running Pies as Inetd
@@ -2816,7 +2820,7 @@ This configuration file allows to run @command{pies} instead of
2816@command{initd}. It starts two services: @samp{ftp} and @samp{pop3d}, 2820@command{initd}. It starts two services: @samp{ftp} and @samp{pop3d},
2817and restricts access to them to two local subnets: 2821and restricts access to them to two local subnets:
2818 2822
2819@smallexample 2823@example
2820acl @{ 2824acl @{
2821 allow from 10.10.10.0/24; 2825 allow from 10.10.10.0/24;
2822 allow from 192.168.10.0/27; 2826 allow from 192.168.10.0/27;
@@ -2839,15 +2843,15 @@ component pop3d @{
2839 program "/usr/sbin/pop3d"; 2843 program "/usr/sbin/pop3d";
2840 command "pop3d --inetd"; 2844 command "pop3d --inetd";
2841@} 2845@}
2842@end smallexample 2846@end example
2843 2847
2844The following is almost equivalent configuration in @command{inetd} 2848The following is almost equivalent configuration in @command{inetd}
2845format: 2849format:
2846 2850
2847@smallexample 2851@example
2848ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -C 2852ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -C
2849pop3 stream tcp nowait root /usr/sbin/pop3d pop3d --inetd 2853pop3 stream tcp nowait root /usr/sbin/pop3d pop3d --inetd
2850@end smallexample 2854@end example
2851 2855
2852This configuration is ``almost'' equivalent, because the 2856This configuration is ``almost'' equivalent, because the
2853@command{inetd} format has no way of specifying ACLs and setting the 2857@command{inetd} format has no way of specifying ACLs and setting the
@@ -2883,11 +2887,11 @@ messages with @var{name}.
2883 For example, the following invocations create three instances of 2887 For example, the following invocations create three instances of
2884@command{pies}: 2888@command{pies}:
2885 2889
2886@smallexample 2890@example
2887pies 2891pies
2888pies --instance=inetd 2892pies --instance=inetd
2889pies --instance=mta 2893pies --instance=mta
2890@end smallexample 2894@end example
2891 2895
2892 The first instance uses the default configuration and state files. 2896 The first instance uses the default configuration and state files.
2893The second one reads configuration from @file{/etc/inetd.conf}, and 2897The second one reads configuration from @file{/etc/inetd.conf}, and
@@ -2897,7 +2901,7 @@ the third one reads it from @file{/etc/mta.conf}.
2897 After startup, you can verify the status of the running process 2901 After startup, you can verify the status of the running process
2898using the @option{--status} command line option: 2902using the @option{--status} command line option:
2899 2903
2900@smallexample 2904@example
2901@group 2905@group
2902$ pies --status 2906$ pies --status
2903smtps/stderr R 4697 2907smtps/stderr R 4697
@@ -2913,7 +2917,7 @@ eklogin IL inet+tcp://0.0.0.0:eklogin /usr/sbin/klogind -k -c -e
2913kshell IL inet+tcp://0.0.0.0:kshell /usr/sbin/kshd -k -c 2917kshell IL inet+tcp://0.0.0.0:kshell /usr/sbin/kshd -k -c
2914eklogin IR 13836 /usr/local/sbin/klogind -k -c -e 2918eklogin IR 13836 /usr/local/sbin/klogind -k -c -e
2915@end group 2919@end group
2916@end smallexample 2920@end example
2917 2921
2918 Each output line contains at least two columns. The first column 2922 Each output line contains at least two columns. The first column
2919lists the tag of the component. The second one contains @dfn{flags}, 2923lists the tag of the component. The second one contains @dfn{flags},
@@ -2969,17 +2973,17 @@ listed in the next column.
2969 You can restart any component by using the 2973 You can restart any component by using the
2970@option{--restart-component} (@option{-R}) option, e.g.: 2974@option{--restart-component} (@option{-R}) option, e.g.:
2971 2975
2972@smallexample 2976@example
2973$ pies -R pmult smtps 2977$ pies -R pmult smtps
2974@end smallexample 2978@end example
2975 2979
2976@xopindex{stop, described} 2980@xopindex{stop, described}
2977 To stop all running components and shut down @command{pies}, use the 2981 To stop all running components and shut down @command{pies}, use the
2978@option{--stop} (@option{-S}) command line option: 2982@option{--stop} (@option{-S}) command line option:
2979 2983
2980@smallexample 2984@example
2981$ pies --stop 2985$ pies --stop
2982@end smallexample 2986@end example
2983 2987
2984@cindex dependencies 2988@cindex dependencies
2985@anchor{dump-depmap} 2989@anchor{dump-depmap}
@@ -2991,7 +2995,7 @@ with rows representing dependents and columns representing prerequisites.
2991An @samp{X} sign is placed on each crossing which corresponds to the 2995An @samp{X} sign is placed on each crossing which corresponds to the
2992actual dependency. For example: 2996actual dependency. For example:
2993 2997
2994@smallexample 2998@example
2995@group 2999@group
2996$ pies --dump-depmap 3000$ pies --dump-depmap
2997Dependency map: 3001Dependency map:
@@ -3009,7 +3013,7 @@ Legend:
3009 3: smtpc 3013 3: smtpc
3010 4: smtps 3014 4: smtps
3011@end group 3015@end group
3012@end smallexample 3016@end example
3013 3017
3014This example corresponds to the configuration file shown in @ref{Hairy 3018This example corresponds to the configuration file shown in @ref{Hairy
3015Pies}. To illustrate how to read it, consider the 4th row of the 3019Pies}. To illustrate how to read it, consider the 4th row of the
@@ -3017,18 +3021,52 @@ table. According to the legend, number 4 means @samp{smtps}
3017component. There are two @samp{X} marks: in columns 1 and 2. This 3021component. There are two @samp{X} marks: in columns 1 and 2. This
3018means that @samp{smtps} depends on @samp{smar} and @samp{qmgr}. 3022means that @samp{smtps} depends on @samp{smar} and @samp{qmgr}.
3019 3023
3020@anchor{dump-prereq} 3024@anchor{trace-prereq}
3021@xopindex{dump-prereq, described} 3025@xopindex{trace-prereq, described}
3022 You can also list prerequisites explicitly: 3026 You can also list prerequisites explicitly:
3023 3027
3024@smallexample 3028@example
3025@group 3029@group
3026$ pies --dump-prereq 3030$ pies --trace-prereq
3027qmgr: smar 3031qmgr: smar
3028smtpc: qmgr 3032smtpc: qmgr
3029smtps: smar qmgr 3033smtps: smar qmgr
3030@end group 3034@end group
3031@end smallexample 3035@end example
3036
3037@noindent
3038To list prerequisites for a particular component, give its name in
3039the command line:
3040
3041@example
3042@group
3043$ pies --trace-prereq smtps
3044smtps: smar qmgr
3045@end group
3046@end example
3047
3048Any number of components can be given in the command line.
3049
3050@anchor{trace-depend}
3051A counterpart option @option{--trace-depend} lists dependencies. Its
3052usage is similar to the described above:
3053
3054@example
3055@group
3056$ pies --trace-depend
3057smtps
3058smtpc
3059qmgr: smtps, smtpc
3060smar: smtps, qmgr
3061@end group
3062@end example
3063
3064@example
3065@group
3066$ pies --trace-depend qmgr
3067qmgr: smtps, smtpc
3068@end group
3069@end example
3032 3070
3033@node Invocation 3071@node Invocation
3034@chapter Pies Invocation 3072@chapter Pies Invocation
@@ -3064,9 +3102,15 @@ of @var{level}.
3064@item --dump-depmap 3102@item --dump-depmap
3065Dump dependency map. @xref{dump-depmap}. 3103Dump dependency map. @xref{dump-depmap}.
3066 3104
3067@opsummary{dump-prereq} 3105@opsummary{trace-depend}
3068@item --dump-prereq 3106@item --trace-depend
3069Dump prerequisite charts. @xref{dump-prereq}. 3107List dependencies for components named in the command line. Without
3108arguments, dependencies for each component are listed. @xref{trace-depend}.
3109
3110@opsummary{trace-prereq}
3111@item --trace-prereq
3112List prerequisites for components named in the command line. Without
3113arguments, prerequisites for each component are listed. @xref{trace-prereq}.
3070 3114
3071@item -E 3115@item -E
3072Preprocess configuration file and exit. @xref{Preprocessor}. 3116Preprocess configuration file and exit. @xref{Preprocessor}.
diff --git a/src/comp.c b/src/comp.c
index 52913ac..851ce5b 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -664,13 +664,19 @@ component_verify (struct component *comp, grecs_locus_t *locus)
664 comp->flags &= ~CF_WAIT; 664 comp->flags &= ~CF_WAIT;
665 } 665 }
666 666
667 if (comp->mode != pies_comp_exec 667 switch (comp->mode)
668 && comp->redir[RETR_OUT].type != redir_null) 668 {
669 case pies_comp_accept:
670 case pies_comp_inetd:
671 if (comp->redir[RETR_OUT].type != redir_null)
669 { 672 {
670 COMPERR (grecs_error, 673 COMPERR (grecs_error,
671 "%s", _("stdout redirection invalid in this mode")); 674 "%s", _("stdout redirection invalid in this mode"));
672 comp->redir[RETR_OUT].type = redir_null; 675 comp->redir[RETR_OUT].type = redir_null;
673 } 676 }
677 default:
678 break;
679 }
674 680
675 for (i = RETR_OUT; i <= RETR_ERR; i++) 681 for (i = RETR_OUT; i <= RETR_ERR; i++)
676 { 682 {
diff --git a/src/meta1parse.c b/src/meta1parse.c
index 4b2fccb..528a80a 100644
--- a/src/meta1parse.c
+++ b/src/meta1parse.c
@@ -296,6 +296,8 @@ meta1_translate_node (struct grecs_node *node)
296 size_t len; 296 size_t len;
297 int err = 0; 297 int err = 0;
298 298
299 if (node->type != grecs_node_block)
300 return 0;
299 comp = component_create (node->ident); 301 comp = component_create (node->ident);
300 for (stmt = node->down; stmt; stmt = stmt->next) 302 for (stmt = node->down; stmt; stmt = stmt->next)
301 { 303 {
@@ -309,7 +311,7 @@ meta1_translate_node (struct grecs_node *node)
309 } 311 }
310 312
311 comp->privs.allgroups = 1; 313 comp->privs.allgroups = 1;
312 comp->dir = META1_QUEUE_DIR (); 314 comp->dir = grecs_strdup (META1_QUEUE_DIR ());
313 comp->redir[RETR_ERR].type = redir_file; 315 comp->redir[RETR_ERR].type = redir_file;
314 comp->redir[RETR_ERR].v.file = NULL; 316 comp->redir[RETR_ERR].v.file = NULL;
315 len = 0; 317 len = 0;

Return to:

Send suggestions and report system problems to the System administrator.