GNU Pies Manual (split by chapter):   Section:   Chapter:FastBack: Init Process   Up: Top   FastForward: Command Line Usage   Contents: Table of ContentsIndex: Concept Index

7 Configuration Examples

In this section we provide several examples of working pies configuration files.

7.1 Simplest Case: Using Pies to Run Pmult

The example below runs pmult (see Pmilter multiplexer program in Mailfromd Manual) utility with the privileges of ‘meta1’ user. Both standard error and standard output are redirected to the syslog facility ‘mail’, priorities ‘err’ and ‘info’, correspondingly.

component pmult {
  command "/usr/local/sbin/pmult";
  user meta1s;
  facility mail;
  stderr syslog err;
  stdout syslog info;
}

7.2 Using Pies to Run Pmult and MeTA1

The example below is a working configuration file for running pmult and all components of MeTA1, configured in /etc/meta1/meta1.conf. The global return-code statement is used to configure pies behavior for some exit codes.

# 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";

7.3 Running Pies as Inetd

This configuration file allows to run pies instead of initd. It starts two services: ‘ftp’ and ‘pop3d’, and restricts access to them to two local subnets:

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";
}

The following is almost equivalent configuration in inetd format:

ftp  stream tcp  nowait  root /usr/sbin/ftpd  ftpd -l -C
pop3 stream tcp  nowait  root /usr/sbin/pop3d pop3d --inetd

This configuration is “almost” equivalent, because the inetd format has no way of specifying ACLs and setting the umask.

GNU Pies Manual (split by chapter):   Section:   Chapter:FastBack: Configuration Examples   Up: Configuration Examples   FastForward: Command Line Usage   Contents: Table of ContentsIndex: Concept Index