GNU Pies NEWS -- history of user-visible changes. 2026-02-06
See the end of file for copying conditions.

Please send Pies bug reports to <bug-pies@gnu.org>.

Version 1.9, 2026-02-06

* return-code statement accepts negations

Negated status codes or signal numbers can appear in the argument
list to the "return-code" command.  The syntax is:

  !0       any status code except 0
  !EX_OK   same as above
  !SIGQUIT any signal except SIGQUIT
  !SIG+10  any signal except 10

For example, the following statement:

  return-code (!0, !SIGHUP, !SIGQUIT) {
	notify root;
  }

will notify root user if the program exits with any status, except 0
or gets terminated with any signal, except SIGHUP and SIGQUIT.

* New flag: deansify

To be used together with "stderr" or "stdout" statements.  This flag
instructs pies to remove ANSI escape sequences from program output
before redirecting it to syslog or a file.

* Syslog subsystem

** Syslog socket is opened on demand.

** New syslog statement: message-queue-size

The statement configures the capacity of the internal log message
queue.  Defaults to 64.

** New syslog statement: fallback-ignore-failures

This boolean statement controls how the program handles I/O errors
occurring when writing to the log fallback file.  By default, such
errors cause abnormal program termination.  This is based on the
fact that log fallback is the last resort when attempting to inform
the user about some condition.  If logging is not that critical,
set this value to true.  This instructs pies to disable log fallback
file when such an error occurs.

* Fix possible double close of redirector descriptors


Version 1.8, 2022-08-13

* New configuration keywords

** sigterm SIG

Available for use in "component" sections.  This statement defines
signal which pies should send to the running component instance in
order to terminate it.  Defaults to SIGTERM.

* Fix the component shutdown sequence

The shutdown sequence is determined taking into account dependencies
between components, so that all dependent components are stopped
before their prerequisite components.

* Fallback log file

Fallback log file is a place where pies writes out of band log messages,
i.e. messages about not being able to open syslog socket or send logs
to it.  Regular log messages are diverted to this file if syslog was
requested, but cannot be used because of a permanent error.

* Bugfixes

** Fix piesctl config reload

** Fix configuration preprocessing.

** Varios fixes in REST API server.

Version 1.7, 2022-01-02

* Changes in configuration preprocessing

** Each included file is preprocessed separately.

The built-in preprocessor is removed.  The #include and #include_once
statements are now regular configuration statements.  Any files
included as a result of #include or #include_once are preprocessed
separately.  This differs from prior versions, were all includes were
expanded first, the obtained material passed to the m4 and the
resulting output was then parsed.

This means that:

1. The mess with two preprocessors (built-in and external) is now
gone.

2. Macros defined in a source file don't pollute the namespace of
another sources.

3. Error locations can be accurately determined.

4. Preprocessor can emit forceful diagnostics (see below) to properly
identify erroneous or otherwise suspicious constructs.

** The `pp-setup' file is gone.

By default, the preprocessor is started as `m4 -s -P' with additional
set of -I options and eventual -D or -U options if these are used in
the command line of pies.  Apart from this, no additional set up is
performed.

** The precedence of -I options is fixed

The -I options are placed in the m4 command line before the options
that configure the default search path.

* New forceful diagnostics statements

** #warning "TEXT"

Emits warning.

** #error "TEXT"

Emits error message.  Further parsing continues, but will end with
failure.

** #abend "TEXT"

Emits error message and stops further processing immediately.

If `#error' or `#abend' is encountered, the effect is the same
as if syntax error has been detected.  If it occurs at pies
startup, the program will terminate abnormally.  If it occurs as
part of the reload sequence in a running instance of pies, the
configuration file will be rejected and old configuration will remain
in effect.

Version 1.6, 2021-07-07

* Selecting preprocessor from the command line.

Two command line options are provided to select the preprocessor to
use instead of the default m4.  The --preprocessor=COMMAND option
instructs pies to use COMMAND as preprocessor.  The --no-preprocessor
option disables the use of the external preprocessor.

The new command line options are available both in pies and in the
client program piesctl.

* piesctl: fix order in which configuration files are examined

As stated in the documentation, program-specific configuration
file piesctl.conf takes precedence over pies.conf.

* Fix reloading of the configuration files.

* Fix compilation with --disable-sysvinit

Version 1.5, 2020-12-14

* Detect if pies is started from docker

This makes the --no-init option unnecessary.

* When running with PID 1, install SIGCHLD handler early

This is to make sure the exited preprocessor command is cleaned up
properly.

* Fix cyclic dependency detection

* New component flag: expandenv

The "expandenv" flag instructs pies to parse the command line
and to expand any references to environment variables within it
as the Bourne shell would have done it.  This allows for expanding
the environment variables without the overhead of actually running
the shell.

This flag is incompatible with the "shell" flag.  When both are used,
the preference is given to "shell" and a warning message to that
effect is issued.

* Component standard stream redirection rewritten from scratch

In particular, redirecting stdout/stderr to syslog no longer requires
starting an auxiliar process.

* The component.facility configuration statement is withdrawn

To specify a particular facility, use the fully qualified
facility.priority argument to the stdout or stderr statement, e.g.:

  stderr syslog local1.err;

* New configuration statement syslog.dev

The statement configures the socket to communicate with the syslog
daemon.  Its argument is either the file name of the local socket
or the IP[:PORT] specification, e.g.

  syslog {
     dev 172.31.255.252;
  }

* Global env section

The "env" section appearing in global context modifies the environment
for the main pies process.  This modified environment will be
inherited by all processes started by pies in the course of its normal
operation.

* New control endpoint /alive

HTTP response to GET /alive/PROG reflects the current state of the
component PROG: 200 if it is running, 503 if not, and 404 if there's
no such component.


Version 1.4, 2019-07-02

* New option --no-init

The --no-init option instructs pies not to switch to init mode if its
PID is 1.  Use this option if you run pies as a process manager in a
docker container.

* New component modes: startup and shutdown

Startup components are run right after pies startup. Any other
components start running only after last startup component has terminated.

Shutdown components are executed at program shutdown, after
all other components have been terminated.

Any number of startup or shutdwon components can be defined in the
configuration file. Such multiple components are run simultaneously,
unless required otherwise by their "prerequisites" and "dependents"
statements.

* New component flag: shell

The 'shell' flag instructs pies to run the component via "/bin/sh -c
$command". Use it if the command should undergo variable expansion,
contains redirections, pipes, etc. E.g.

  component X {
    flags shell;
    command "if [ -n \"$X\" ]; then foo; else bar; fi"
  }

* Improved cyclic dependency diagnostics

* New 'env' statement

The 'env' statement has been re-implemented as a compound statement.
It can contain the following sub-statements:

** clear
Clears the environment

** keep NAME
Keeps the variable NAME when clearing the environment. Implies
"clear". NAME can be a globbing pattern, in which case all
variables matching the pattern are retained.

** set "NAME=VALUE"
Sets the environment variable for the component. VALUE is subject
to variable expansion.

** eval "VALUE"
Perform variable expansion on VALUE and discard the result (similar
to the shell ":" command). Useful for side effects, e.g.:

  eval ${HOME:=/home/t}

** unset NAME
Unsets the variable. NAME can be a globbing pattern, in which case all
variables matching the pattern are unset.

Example:

 env {
   clear;
   keep PATH;
   keep MANPATH;
   keep "LC_*";
   set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man";
 }

* Legacy 'env' statement.

Support for the old one-line syntax of "env" is retained for
backward compatibility.

Previous versions applied unnecessary word splitting if given a
single argument. This is now fixed, so that e.g. the following
statement is processed correctly and defines a single variable
X to have the value "foo bar":

  env "X=foo bar"

* New environment variable available for commands started from return-code

Programs started via "exec" statement in the "return-code" block
obtain the PID of the master pies process in environment variable
PIES_MASTER_PID.

* Improved testsuite


Version 1.3, 2016-10-01

* SysV-style Init

GNU Pies can now be used as init process daemon - the first process
started during booting.  The configuration can be supplied both as
a traditional /etc/inittab file or as a native GNU Pies configuration
file.  The control interface provides extensive monitoring and
management capabilities.

* Control interface

The running GNU Pies instance can be queried and reconfigured on the
fly via a TCP socket (either UNIX or INET).  Special utility, piesctl,
is included, which provides  command line interface for inspecting
the state of components, reloading configuration (including addition
or removal of configuration files on the fly), stopping and restarting
components, etc.

* Changes in configuration

Two new flags are provided:

- siggroup

This flag instructs pies to send termination signal to the process
group of the process being stopped.

- nullinput

Do not close standard input.  Redirect it from /dev/null
instead.   Use this option with commands that require their standard
input to be open (e.g. pppd nodetach).

** String concatenation

The adjacent string concatenation feature proved to create more
problems than solutions (in particular, with the "env" statement)
and was removed.


Version 1.2, 2009-12-11

* First release as a GNU package.

* Full inetd support

The program supports all types of services (including built-in
ones) and all types of protocols offered by the traditional `inetd'
utility.

The `inetd.conf' configuration file format is supported.  The
`inetd' configuration file may be supplied either from the command
line (see below), or via the `include-inetd' configuration statement.

* Inetd replacement

A replacement script for inetd(8) is provided.  It is fully
compatible with the traditional inetd command line, but offers
the flexibility and new features of pies.

* Configuration file handling

Several configuration files, eventually of different types,
can be specified in the command line.  New command line
option `--syntax' declares the syntax of configuration
files that follow it, e.g.:

pies --config-file /etc/pies.conf \
     --syntax=inetd --config-file /etc/inetd.conf \
     --syntax=meta1 --config-file /etc/meta1/meta1.conf

* New keywords.

Component keywords: flags, service, socket-type,
max-instances, max-rate, qotd-file.
Global keywords: state-directory, include-inetd.

* New option --instance

The `--instance' option allows you to run several instances
of pies, each of them using separate configuration and
state files.

* New option --rate

For compatibility with inetd.

* Improved status output.


Version 1.1, 2009-10-20

* Account for possible system clock inaccuracies.
* Improve documentation.
* Add Polish and Ukrainian translations.


Version 1.0, 2009-10-17

First stand-alone release.  Previous versions were released as
part of Mailfromd (http://mailfromd.software.gnu.org.ua).


=========================================================================
Copyright information:

Copyright (C) 2009-2026 Sergey Poznyakoff

   Permission is granted to anyone to make or distribute verbatim copies
   of this document as received, in any medium, provided that the
   copyright notice and this permission notice are preserved,
   thus giving the recipient permission to redistribute in turn.

   Permission is granted to distribute modified versions
   of this document, or of portions of it,
   under the above conditions, provided also that they
   carry prominent notices stating who last changed them.

Local variables:
mode: outline
paragraph-separate: "[	]*$"
eval: (add-hook 'write-file-hooks 'time-stamp)
time-stamp-start: "changes. "
time-stamp-format: "%:y-%02m-%02d"
time-stamp-end: "\n"
end:
