2009-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* src/Makefile.am: Fix rules for inetd.

2009-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Final cleanup for version 1.2.

	* configure.ac (INETD_SH): Rename to INETD.
	* NEWS: Update.
	* src/.gitignore (inetd.sh): rename to inetd.
	* doc/pies.texi: Update.
	* src/Makefile.am (pkgstatedir): New variable.
	(AM_CPPFLAGS): Add define.
	(inetd.sh): Replace with inetd.
	(install-exec-hook): Remove.
	* src/pies.c (statedir): New variable.
	(pies_keywords): New keyword: "state-directory".
	(set_file_names): Split in two functions:
	(set_conf_file_names, set_state_file_names).
	(main): Call set_conf_file_names before,
	and set_state_file_names after parsing the configs.

	Finish the docs.

	* doc/inetd.texi: Update.
	* doc/pies.texi: Update.

	New meta-variable for notifications.

	* src/progman.c (notify): New meta-var "instance".

	Bugfixes.

	* src/meta1gram.y (xlat_listen_socket): Handle
	all relevant assignments in the listen_socket block.
	* src/url.c (url_parse_host): Always assign port_s.
	Handle arguments without preceding path.
	(url_parse_user): Parse path without preceding
	user/pass specs.
	(url_parse_scheme): Require exactly two slashes
	after 'scheme:'.

2009-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Document state files and instances.

	* doc/pies.texi: Update.

	Improve status output.

	* doc/pies.texi: Document new status output format.
	* src/progman.c (progman_dump_stats): Redesign flags column.

	Upgrade grecs.

	Improve docs + bugfix.

	* doc/inetd.texi: New file.
	* doc/Makefile.am: Add inetd.texi.
	* doc/pies.texi, doc/usr-acl.texi: Update.
	* src/pies.c (socktype_xtab): SOCK_PACKET not always defined.

	Update

	* doc/macros.texi (xprindex)
	(example-output, mtasimopt): Remove
	(RFC): New macro.
	* doc/pies.texi: Document inetd-style components.
	* doc/Makefile.am (fix-sentence-spacing): Fix rule.
	* src/progman.c (progman_lookup_tcpmux): Use case-insensitive
	comparison, as required by RFC.

2009-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve docs.

	* doc/fix-sentence-spacing.sed: New file.
	* doc/Makefile.am (EXTRA_DIST): Add fix-sentence-spacing.sed.
	(check-tabs, check-sentence-spacing)
	(fix-sentence-spacing): New rules.
	(check-format): Rewrite rule.
	* doc/pies.texi: Update.

2009-12-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes

	* doc/pies.texi: Update
	* src/progman.c (run_command): handle return-code for inetd
	components.

2009-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	New option --instance.

2009-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Optionally provide an inetd wrapper.

	* configure.ac: New option --enable-inetd
	* src/inetd.in: New file.
	* src/.gitignore: Add inetd.sh.
	* src/Makefile.am (inetd.sh): New goal.
	(install-exec-hook): New rule.

	Handle per-tcpmux ACL's. Optionally pass socket data via
	environment variables.

	* src/inetd-bi.c (tcpmux): Consult the component's ACL
	before deciding whether to handle the connection.
	* src/pies.c (str_to_socket_type): Rewrite using
	strtotok.
	(socket_type_to_str): New function
	(str_to_cf): New flags: sockenv and
	resolve. Use strtotok.
	(main): Log_tag defaults to program instance name.
	* src/pies.h: Include socket-related headers.
	(CF_SOCKENV, CF_RESOLVE): New flags.
	(pies_sockaddr_storage): New union.
	(check_acl): New proto.
	(progman_run_comp): Change signature.
	(socket_type_to_str): New proto.
	* src/progman.c (struct prog): New members sa_storage,
	sa_len.
	(prog_sockenv): New function.
	(progman_run_comp): Call prog_sockenv.
	Initialize sa_storage and sa_len of the created
	struct prog.
	(prog_start): Call prog_sockenv.
	Do not close 2 if logging to stderr.
	(check_acl): Remove static.
	(_prog_accept): Use union pies_sockaddr_storage.
	Pass socket address in pinst->v.p.sa_storage and
	pinst->v.p.sa_len.
	(sockenv_hint, envsize): New variables.
	(add_env): New function.
	(env_setup): Remove.
	(environ_setup): New function.
	* src/socket.c: Remove unnecessary includes.

2009-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to grecs master.

	Fix config-help output

	Implement internal inetd services in the pies config.

	* src/pies.h (CF_INTERNAL): New flag.
	(ISCF_TCPMUX): New macro.
	(struct component): Reorder fields.
	New field: tcpmux.
	(progman_lookup_service): Remove proto.
	(progman_lookup_tcpmux): New proto.
	(struct inetd_builtin.foo): Change signature. All uses updated.
	* src/progman.c (progman_lookup_service): Remove.
	(progman_lookup_tcpmux): New function.
	(progman_create_sockets): Skip tcpmux subservices.
	(progman_start): Skip disabled inetd components.
	* src/inetd-bi.c (tcpmux): Use progman_lookup_tcpmux.
	* src/inetd.c (tcpmux_service, mktag): New functions.
	(inetd_conf_file): Minor changes.
	* src/pies.c (_cb_bitmask, _cb_precious)
	(_cb_disabled, _cb_wait): Remove.
	(str_to_cf, _cb_flags): New functions.
	(component_keywords): Remove keywords:
	disable, precious, wait.
	Add keywords: flags, service, tcpmux-master.
	(component_verify): Improve.
	* src/url.c (pies_url_destroy): Fix coredump on NULL argument.

	Allow to specify several config files in the command line.

	Change output --status format.

	* src/pies.c (instance): New global.
	(conffile): Remove.
	(pidfile,ctlfile,statfile,qotdfile): Remove initializers.
	(config_syntax, config_file): New types.
	(conf_head, conf_tail): New variables.
	(config_syntax_tab): New variable.
	(add_config): New function.
	(options): New option --syntax.
	(current_syntax): New variable.
	(parse_opt): Change handling of -i
	(mkfilename, set_file_names): New functions.
	(main): Allow to specify several different config files
	in the command line.

	* src/progman.c (progman_dump_stats): Change
	output format.

2009-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement TCPMUX internal service.

	* src/pies.h (CF_TCPMUX, CF_TCPMUXPLUS): New flags.
	(struct component): New member: service.
	(progman_lookup_service, progman_run_comp)
	(progman_iterate_comp): New protos.
	* src/progman.c (progman_iterate_comp)
	(prog_lookup_by_service)
	(progman_lookup_service): New functions
	(prog_start_prologue, prog_execute): New functions,
	extracted from prog_start.
	(progman_run_comp): New function.
	(prog_start): Replace extracted parts of code with calls
	to prog_start_prologue and prog_execute.
	* src/inetd-bi.c: Implement TCPMUX
	* src/inetd.c (inetd_conf_file): Handle tcpmux extries.

2009-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement inetd builtin services.

	* src/inetd-bi.c: New file.
	* src/Makefile.am (pies_SOURCES): Add inetd-bi.c.
	* src/pies.h (struct component): New member `builtin'.
	(qotdfile): New extern.
	(inetd_builtin): New struct.
	(inetd_builtin_lookup): New proto.
	* src/progman.c (prog_start): Handle internal
	services.
	* src/inetd.c (inetd_conf_file): Handle internal
	services.
	* src/pies.c (qotdfile): New global.
	(pies_keywords): New keyword "qotd-file".

	Implement inetd connection rate.

	* src/pies.h (struct component): New member "max_rate".
	(default_max_rate): New extern.
	* src/progman.c (check_rate): New function.
	(check_spawn_rate, check_connection_rate): New functions.
	(prog_open_socket): New function.
	(prog_start): Rewrite using the above functions.
	(_prog_accept): Check connection rate.
	(progman_start): Special handling for inetd listeners.
	(progman_wake_sleeping): Likewise.
	* src/pies.c (default_max_rate): New global.
	(component_keywords): New keyword max-rate.
	(options): New option "rate".
	(parse_opt): Handle the new option.
	* src/inetd.c (inetd_conf_file): Set max_rate, instead of
	max_instances.

	Implement parsing of inetd.conf files.

	* src/Makefile.am (pies_SOURCES): Add inetd.c.
	* src/inetd.c: New file.
	* src/pies.c (inetd_mode): New global.
	(str_to_socket_type): New function.
	(_cb_socket_type): Use str_to_socket_type.
	(_cm_include_meta1): Rename to _cb_include_meta1.
	(_cb_include_inetd): New function.
	(pies_keywords): New keyword "include-inetd".
	(options): New option --inetd.
	(main): Handle inetd mode.
	* src/pies.h (str_to_socket_type): New proto.
	(disable_socket, enable_socket): Fix return type.
	* src/progman.c (redirect_to_file): Avoid coredump on
	privs.user == NULL.
	(open_redirector,env_setup)
	(progman_start,run_command): Remove unneeded variable.
	(progman_start): Fix diagnostic message.
	* src/socket.c (disable_socket, enable_socket): Fix return type.
	Do nothing if fd < 0.
	* src/userprivs.c (switch_to_privs): Allow to pass uid==0.

	Handle non-stream sockets. Pies can now replace inetd (-
	inetd.conf and built-in services).

	* src/pies.c (component_keywords): New keywords: wait,
	socket-type.
	(component_verify): Add more checks.
	* src/pies.h (CF_WAIT): New define.
	(struct component): New member: socket_type.
	(struct pies_url): Rename proto to scheme.
	New members: proto, proto_s, port_s
	(register_listener): Remove proto.
	(register_socket): New proto.
	(create_socket): Change signature.
	(disable_socket, enable_socket): New protos.
	* src/progman.c (close_fds): New function.
	(open_redirector): Use close_fds.
	(prog_start): Use close_fds.
	Update call to create_socket.
	Disable socket if wait is set.
	(progman_accept): Support non-stream
	(and stream+wait) sockets.
	(component_fixup_depend): Update call to create_socket.
	Call register_socket.
	(run_command): Use close_fds.
	Re-enable socket if wait is set.
	* src/socket.c (create_socket): Take additional argument:
	socket_type.
	(register_socket): New function.
	(disable_socket, enable_socket): New functions.
	(pies_pause): Add missing break.
	* src/url.c (url_parse_host): Accept service name
	and numberic port number.
	(url_parse_proto): Rename to url_parse_scheme. All callers
	updated.
	(url_parse_scheme): Allow for optional
	protocol specification in scheme field (after a '+' sign).
	(pies_url_destroy): Free new fields.

2009-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Limit number of instances for inetd-style components.

	* src/pies.c (component_keywords): New keyword
	`max-instances'.
	* src/pies.h (struct component): New member:
	max_instances.
	* src/progman.c (struct prog): Rename count to
	failcount. All uses changed.
	New members num_instances and listener.
	(progman_accept): Keep track of the number of
	instances. Deny connection if it is greater than
	max_instances (unless the latter is 0).
	(progman_cleanup): Keep track of the number of
	instances in inetd listeners.

	Minor change.

	* src/pies.h (CF_DISABLED)
	(CF_PRECIOUS): New defines.
	(struct component): Replace precious and
	disabled by a bitmask member `flags'. All uses updated.
	* src/progman.c: Reflect the above change.
	* src/pies.c (_cb_bitmask): New function.
	(_cb_precious, _cb_disabled): New callbacks.
	(component_keywords): Change handling of precious and disabled.
	* bootstrap.conf: Add Emacs mode marker

2009-11-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Take translations from the TP.

2009-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

	* src/depmap.c (struct pies_depmap.nrows,rowlen): Change type
	to size_t.
	(depmap_alloc, depmap_rowptr)
	(depmap_set, depmap_isset)
	(depmap_next, depmap_first): Use size_t to index map elements.
	* src/pies.h: Update prototypes accordingly.
	* src/progman.c: Update depmap function usage.

2009-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix doc/Commit

	* doc/Commit (gray_print_section): Output anchors before
	chapter/section/etc. titles, so that the heading menu in
	monolithic document works properly.

2009-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rearrange structures prog and component.

	* config_array_to_argv (config_array_to_argv): Take four
	arguments.
	Return argc in the memory location pointed to by the 4th one
	(unless NULL).
	All callers updated.
	(_cb_command): Fill both comp->argv and comp->argc.
	(component_keywords): Pass pointer to struct component to
	_cb_command.
	* src/pies.h (struct component): New member `argc'.
	* src/progman.c (struct prog): Move idx to v.p; change its type
	to unsigned.
	Remove v.p.argc. All uses updated.
	(numprog): Rename to numcomp; change type to unsigned.
	(prog_lookup_by_idx): Check only elements of type
	TYPE_COMPONENT.

	Register mailers and `exec' actions in the prog list.

	* src/pies.c (return_code_keywords): Fix docstring wording.
	* src/progman.c (prog_type): New enum.
	(struct prog): New union member `c'.
	(IS_PROG): Rename to IS_COMPONENT.
	(destroy_prog): Handle TYPE_COMMAND.
	(register_command): New function.
	(wait_for_child): Remove.
	(propagate_child_exit): New function.
	(wordsplit_string): New function.
	(send_msg): Register command.
	In child: Reset all signals; call propagate_child_exit.
	(run_command): Do not reset SIGPIPE.
	Register command.
	(progman_cleanup): Handle TYPE_COMMAND.
	(progman_stop_component): For sleeping components, reset
	v.p.count.
	(progman_dump_stats): Handle TYPE_COMMAND.

	Improve diagnostic output.

	* src/diag.c (diag_output): New variable.
	(diag_setup): New function.
	(vlogmsg): Use diag_output to decide where to
	output the message. Output to both stderr and
	syslog if diag_output says so.
	* src/pies.c (log_to_stderr): Rename to log_to_stderr_only.
	All uses changed.
	(log_setup): Remove.
	(main): Use diag_setup to initialize diagnostics.
	* src/pies.h (log_to_stderr): Remove.
	(DIAG_TO_SYSLOG, DIAG_TO_STDERR): New defines.
	(diag_setup): New function.

	Minor changes

	* doc/Config (EXTRA_HEAD, AFTER_BODY_OPEN): Use qq{} to quote
	contents.
	* doc/fdl.texi: Upgrade to v.1.3.
	* doc/pies.texi: Likewise.

	Pies dubbed a GNU package. Update all files accordingly.

2009-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* doc/Config: Fix links in the main menu.

	Version 1.1

	* configure.ac, NEWS: Raise version number.

	Fix diagnostics.

	* po/POTFILES.in: Add missing files.
	* src/acl.c, src/meta1lex.l, src/pies.c,
	src/progman.c, src/socket.c,
	src/userprivs.c: Fix diagnostic messages.

2009-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update.

	* doc/Config, doc/gendocs_template: Update for the new
	layout.

	Updates.

	* src/meta1lex.l (%top): Include config.h to accomodate for the
	latest gnulib. This requires flex >= 2.5.30
	* grecs: Upgrade.

	Account for possible system clock inaccuracies.

	* src/pies.h (progman_wake_sleeping): Takes one argument.
	* src/progman.c (progman_wake_sleeping): Takes one argument.
	Account for possible clock inaccuracy.
	(progman_cleanup): Print correct signal number in the diagnostics.
	Update call to progman_wake_sleeping.
	* src/pies.c (main): Update call to progman_wake_sleeping.

2009-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Imrove the docs.

	* doc/Config: New file. Configuration for texi2html.
	* doc/Makefile.am (manual): Update rule.
	(man-tar): New rule.
	* doc/gendocs_template: Rewrite using the new site
	layout.
	* doc/pies.texi: Minor changes.

2009-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Release 1.0.

	* NEWS: Update.
	* bootstrap.conf: Call submodule init unconditionally.
	* doc/pies.texi: Minor changes.

2009-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* src/acl.c (acl_hasher): Fix signature.
	* src/progman.c (notify): Fix warnings.

	Move to grecs master.

	Improve diagnostics output.

	* configure.ac (AC_CHECK_FUNCS): Remove checks for unused
	functions.
	* gnulib.modules: Add fprintftime. Remove quote.
	* src/pies.c (pidfile_read): Do not print error message if
	'No such
	process' is returned.
	(main): Set default quoting style to shell.
	* src/pies.h: Include fprintftime.h.
	* src/progman.c (prog_start, progman_dump_stats): Quote
	arguments on
	output.
	(progman_dump_stats): Use fprintftime.

	Move to grecs master.

	Implement -D and -U options (preprocessor control).

	* Makefile.am (dist-hook,alpha,alphacheck): New rules.
	(ChangeLog): Be silent.
	* NEWS: Update.
	* doc/pies.texi: Update.
	* gnulib.modules: Add quote and quotearg
	* src/pies.c: Implement -D and -U options. Improve --help
	output.
	* src/pies.h: Include quotearg.h

	Various improvements.

	* configure.ac (AC_CHECK_FUNCS): Check for vsyslog.
	* src/diag.c (syslog_printer) [!HAVE_VSYSLOG]: call syslog.
	* src/pies.c (component_keywords): Remove settle-timeout,
	replace it with pass-fd-timeout.
	(main): Force syslog logging if !foreground.
	Do not close first three fds before restarting
	if log_to_stderr is set.
	* src/pies.h (DEFAULT_PASS_FD_TIMEOUT): New constant.
	(struct component): Replace settle_timeout with
	pass_fd_timeout. All uses changed.
	(pass_fd): Pass timeout as argument.
	* src/progman.c (prog_start): Remove hardcoded sleep before
	calling pass_fd. Update call to pass_fd.
	(prog_start_prerequisites): Remove handling of settle_timeout.
	* src/socket.c (open_unix_socket): Remove.
	(pass_fd): Rewrite.

	* doc/pies.texi: Update.

2009-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Proofread the docs.

	* doc/pies.texi: Final cleanup.
	* doc/usr-acl.texi: Minor fix.

	More fixes.

	* doc/pies.texi: More fixes.
	* pp-setup: Remove MFD leftovers.

	Various fixes.

	* README: Fix typo.
	* doc/usr-acl.texi: New file.
	* doc/Makefile.am (pies_TEXINFOS): Remove pies.texi,
	add usr-acl.texi
	(check-config, check-sub-config): Handle @deffnx
	* doc/pies.texi: Update.
	* src/Makefile.am (AM_CPPFLAGS): Remove superfluous defs,
	use ../gnu/configmake.h instead
	* src/acl.c (_acl_common_section_parser): Handle tag, depending
	on the value of `flag' parameter.
	Avoid coredumping on NULL pacl.
	(acl_section_parser, defacl_section_parser): Update calls to
	_acl_common_section_parser.
	* src/pies.c (STATEDIR): Replace with LOCALSTATEDIR.
	(GRECS_VALUE_IS_EMPTY): New define (possibly belongs to
	grecs more than to pies).
	(assert_grecs_value_type)
	(return_code_section_parser): Use GRECS_VALUE_IS_EMPTY to check
	for empty value.
	(_get_array_arg): Bugfix.
	(component_keywords, pies_keywords): Add missing docstrings.
	* src/progman.c (TYPE_RETR): Rename to TYPE_REDIRECTOR.
	All uses updated.

2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes.

	* doc/Makefile.am (check-sub-config): Silent the rule.
	* doc/pies.texi: Update.
	* src/progman.c (default_termination_message): Use ${termination}
	(notify): Fix wording in ${termination}.

	Fix ACL code.

	* src/acl.c (pies_acl_create): Accept NULL name.
	(_parse_sockaddr): Fix calculation of netmask.
	(_acl_common_section_parser): New function.
	(acl_section_parser): Rewrite using _acl_common_section_parser.
	(defacl_section_parser): New function.
	(_check_sockaddr): Bugfix.
	(_acl_check): Break the loop when _check_sockaddr
	returns 1.
	(pies_acl_check): Break the loop when _acl_check_cb
	returns 1.
	* src/acl.h (defacl_section_parser): New prototype.
	* src/pies.c (component_keywords): New keyword
	defacl.

2009-10-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* README: Update.
	* configure.ac: Change bug-reporting address.
	* doc/pies.texi: Minor fixes.
	* src/pies.c: New configuration statements: mailer-program
	and mailer-command-line.
	(mailer_program, mailer_command_line)
	(mailer_argc, mailer_argv): New globals.
	* src/pies.h (mailer_program, mailer_command_line)
	(mailer_argc, mailer_argv): New globals.
	* src/progman.c (destroy_prog): Bugfix: update master
	program when destroying a retranslator.
	(send_msg): Several bugfixes. Use mailer_argc, mailer_argv
	instead of hardcoding sendmail command line. Remove
	invalid recipient addresses from the resulting command line.

2009-10-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix make distcheck and check-docs.

	* doc/Makefile.am: Fix `check-*' goals.
	* doc/pies.texi: Update and rearrange material.
	Document new configuration.
	* lib/Makefile.am (libpies_a_SOURCES): Remove nls.c
	* src/Makefile.am (EXTRA_DIST): Remove pies.rc, add
	pp-setup.
	(INCLUDES): Add $(top_builddir)/gnu
	* src/pies.c: Minor changes.
	* src/progman.c: Minor changes.
	* README-hacking: New file.

	Do not require Mailutils. Provide missing functions.

	* Makefile.am (ACLOCAL_AMFLAGS): Add grecs/am
	* bootstrap.conf: Skip po.
	Initialize submodule.
	* configure.ac: Mailutils no longer needed.
	(AC_CONFIG_FILES): Add new subdirs.
	* gnulib.modules: Add more modules. Arrange entries
	alphabetically.
	* lib/Makefile.am: Rename library to libpies.
	* lib/libpies.h (mf_privs)
	(switch_to_privs, get_user_groups)
	(mf_priv_setup, mf_epriv_setup): Move to src/pies.h
	(config_array_to_argv, config_array_to_string)
	(config_cb_timeout): Remove.
	(tokendef): New struct.
	(strtotok_len, strtotok_len_ci)
	(strtotok, strtotok_ci, toktostr): New prototypes.
	* lib/nls.c: Remove call to mu_init_nls.
	* src/acl.c: New file.
	* src/addrfmt.c: New file.
	* src/diag.c: New file.
	* src/meta.c: New file.
	* src/url.c: New file.
	* src/userprivs.c: New file.
	* src/acl.h: New file.
	* src/pp-setup: New file.
	* src/Makefile.am (pies_SOURCES): Add acl.c,
	addrfmt.c, diag.c, meta.c, url.c, userprivs.c.
	(noinst_HEADERS): Add acl.h.
	(inc_DATA): Add pp-setup.
	* src/limits.c, src/meta1gram.y,
	src/meta1lex.h, src/meta1lex.l,
	src/pies.c, src/pies.h, src/progman.c,
	src/socket.c, src/userprivs.c: Remove calls to
	functions from Mailutils.

2009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Branch off from the Mailfromd project into a separate repository.

2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix diagnostic and help messages.

	1. Option descriptions in `--help' output do not constitute
	   conceptual sentences. Therefore, they should not begin
	   with a capital letter, nor end with a final point.
	2. According to standards.texi, a diagnostic message in a
	   non-interactive program "should not begin with a capital letter
	   when it follows a program name and/or file name, because that
	   isn't the beginning of a sentence.  (The sentence conceptually
	   starts at the beginning of the line.)  Also, it should not end
	   with a period."

	Affected files:

	* pies/pies.c
	* pies/progman.c

2009-06-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* pies/pies.c (main): Change main loop to do..while,
	otherwise a signal arriving before entering the loop
	might cause the program to terminate.

2009-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix and improve termination actions.

	* pies/pies.h (MAX_RETURN_CODE): Remove.
	(STATUS_SIG_BIT, STATUS_CODE): New defines
	(struct action): New fields next, nstat, status, command.
	(struct component): Keep singly-linked list of termination
	actions.
	* pies/progman.c (run_command): New function.
	(progman_cleanup): Redo iteration over termination actions.
	* pies/pies.c (return_code_cfg_param): Pass offsets in
	struct component.
	(create_action): Accept signal numbers (SIG.* or SIG\+[0-9]+)
	in tag.
	(return_code_section_parser): Update.
	(pies_check_status): Set *pid before returning pies_status_stale.
	* doc/pies.texi: Document changes.

2009-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	MeTA1-related improvements.

	* pies/pies.c (_cm_include_meta1): Fix coredump on syntax errors
	in meta1.conf.

2009-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	More work on `silent rules' mode

	* pies/Makefile.am: Add silent rule markers.

2009-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change

	* pies/progman.c: Use _exit in child processes.  This
	is a work over a fault in MU design: it registers
	the pidfile removal function via atexit.

2008-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* doc/pies.texi: Update.

	git-svn-id: file:///svnroot/mailfromd/trunk@1771
	7a8a7f39-df28-0410-adc6-e0d955640f24

2008-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Documentation and minor fixes.

	* pies/pies.c, pies/progman.c, pies/meta1gram.y, pies/pies.h,
	pies/meta1lex.l: Normalize output redirection terminology, fix the
	debug levels.
	* doc/pies.texi: Document the configuration.

2008-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (component_cfg_param): New statement settle-timeout.
	* pies/progman.c (recompute_alarm): New static;
	(prog_start): Start the component only if all of its prerequisites
	are running.
	(progman_recompute_alarm): New function.
	(progman_start): Reset recompute_alarm to 0.
	(check_stopping): New function.
	(progman_wake_sleeping): Handle also status_stopping and
	status_enabled. Recompute alarm before leaving.
	(prog_start_prerequisites): Return 0 or 1 depending on whether all
	prerequisites have been started.
	(prog_stop): Raise recompute_alarm for stopping components.
	(progman_cleanup): Force status_enabled before attepmting to
	start a component.
	(progman_cleanup): Add a \n after debugging message.
	Run progman_wake_sleeping unlsess expect_term is set.
	* pies/meta1gram.y (translate_node_list): Force settle-timeout =
	1.
	* pies/pies.h (struct component.settle_timeout): New member.

	* pies/pies.c (main): New options --force, --dump-prereq and
	--dump-depmap.
	Refuse to start if another instance is already running.
	(pies_check_status): New function.
	(pies_status): Rewrite using pies_check_status.
	* pies/progman.c (component_fixup_depend): Bugfix: move
	mu_list_append off the conditional.
	(progman_dump_prereq, progman_dump_depmap): New functions.
	* pies/meta1gram.y (yyerror): Return 0.
	* pies/pies.h (progman_dump_prereq, progman_dump_depmap): New
	protos.
	(meta1_parser_set_debug, meta1lex, meta1error)
	(meta1parse): Likewise.
	
	* pies/progman.c (print_dep): New function.
	(progman_build_depmap): Call print_dep to facilitate fixing cyclic
	dependencies.
	(prog_start_prerequisites): Fix debugging output.
	Remove spurious second loop (was it a typo or copy-paste
	leftover?)
	(prog_stop_dependents): Fix debugging output.
	(progman_dump_stats): Avoid race conditions between running and
	querying instances.

2008-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix handling of retranslators.
	
	* pies/pies.c (main): Call progman_build_depmap and
	progman_create_sockets before starting up components.
	* pies/progman.c (struct prog): New member `retr'.
	(destroy_prog): New function.
	(retr_tag): Change signature. Fix erroneous condition for
	xalloc_die.
	(register_retr): Return prog. Make static. Initialize idx
	with -1.
	(update_retr): Register retranslator, if necessary.
	(progman_register_retranslators): Remove.
	(register_prog0): 2nd argument: index.
	(register_prog): Do not create socket at once.
	(prog_start): Remove debugging fprintf.
	(progman_accept): Update call to register_prog0.
	(progman_create_sockets): New function.
	(progman_start): Remove calls to progman_register_retranslators
	and progman_build_depmap. They must be done only once.
	(prog_stop_retranslators): New function.
	(prog_stop_dependents): Call prog_stop_retranslators.
	(progman_cleanup): Remove dangling retranslators.
	* pies/pies.h (progman_create_sockets): New prototype.

2008-11-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve pies.
	
	* pies/pies.h (create_socket): Change proto to 3 arguments.
	* pies/socket.c (create_socket): Take two additional arguments.
	Allow to configure ownership and mode of created UNIX sockets.
	* pies/progman.c (register_prog, prog_start): Update calls to
	create_socket.

2008-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve handling of program privileges.
	
	* pies/pies.h (struct pies_privs_data): Remove
	(struct component): Change type of `privs' to struct mf_privs.
	(priv_setup): Remove.
	* pies/pies.c: Use mf_priv* stuff to manipulate privileges.
	* pies/progman.c: Likewise.
	* pies/meta1gram.y (list): allow for trailing comma.

2008-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/progman.c, pies/pies.h: Use umaxtostr, instead
	of mu_umaxtostr.

2008-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/progman.c (env_setup): Port new implementation from Rush.

2008-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (component_cfg_param): New configuration statement
	`precious'.
	* pies/progman.c (struct prog): New member `precious'.
	(register_prog): Set precious.
	(prog_start_dependencies): Do not mark disabled precious
	dependencies of a disabled component.
	* pies/pies.h (pies/pies.h): New member `precious'.
	* pies/pies.rcin (mcp): Mark as precious.

	* pies/pies.c (return_code_section_parser): Fix to work with tag
	of any type.
	* pies/pies.rcin: Minor change.

	* pies/pies.c (main): Do cleanup after main action processing and
	only if action == ACTION_CONT.
	* pies/progman.c (struct prog): New member `prev'.
	(link_prog): Maintain doubly-linked list.
	(prog_stop_dependent): Avoid printing diagnostics if there are
	no dependencies to be stopped.
	(prog_stop): Do nothing if prog->pid is zero.
	Do not call prog_stop_dependent, it will be done by
	progman_cleanup. 
	(prog_stop_all): Terminate components from last to first.
	* pies/pies.rcin: Improve example, by adding mcp component.
	
	* pies/pies.c (_cb_depend): Handle single string value.
	(_cb_retr): Fix diagnostic message.
	(_cb_facility): New function.
	(component_cfg_param): New statement `facility'.
	(component_section_parser): Initialize comp.facility to the
	default value.
	* pies/progman.c (struct prog): New member `facility'.
	(register_prog): Initialize facility.
	(open_retranslator): Use master->facility.
	* pies/pies.h (struct component): New member `facility'.

2008-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/progman.c (register_prog): Remove stray semicolon.
	(retr_exit): Use _exit.
	(prog_stop_dependent): Bugfix: stop retranlators as well as
	components.

2008-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

        * pies/pies.c: Rewrite configuration
	file support to match changes in Mailutils.

2008-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c: Change description.

2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.h: Include stdint.h

2008-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c: New configuration statement "chdir".
	* pies/progman.c (struct prog.v.p): New member `dir'.
	(register_prog): Initialize newp->v.p.dir;
	(prog_start): Change to the working directory, if required by
	config.

2008-02-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (progman_wake_disabled): Renamed to
	progman_wake_sleeping.
	* pies/progman.c: Implement proper handling of dependencies.
	* pies/pies.h ((progman_wake_disabled): Renamed to
	progman_wake_sleeping.
	(pies_depmap_t,pies_depmap_pos_t,enum pies_depmap_direction): New
	types.
	(depmap_alloc,depmap_copy,depmap_set,depmap_isset,depmap_tc)
	(depmap_first,depmap_next): New functions.
	* pies/depmap.c: New file.
	* pies/Makefile.am (pies_SOURCES): Add depmap.c.

	* pies/pies.c (return_code_section_parser): Allow to use symbolic
	exit codes.
	(priv_setup): Exit with EX_CONFIG if the user does not exist.
	(main): Catch early sigchlds as well.
	* pies/progman.c (progman_cleanup): Fix notice wording.
	* pies/pies.rcin: Add sample return-code section.
	(component pmult): Redirect stderr/stdout to syslog.

2008-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement configurable actions depending on the exit code of
	a component.
	
	* pies/pies.c: New configuration file section "return-code".
	(capa): Add mailer and debug.
	(main): Register "return-code" section and all mailer formats.
	* pies/progman.c (enum prog_status): New type.
	(struct prog): Remove `disabled'. New fields `status' and `act'.
	(register_prog): Initialize act.
	(prog_start): Exit with EX_SOFTWARE code if the component cannot
	be started.
	(progman_start): Do not start disabled components.
	(progman_wake_disabled): Wake only components marked as
	status_stopped.
	(notify): New function.
	(progman_cleanup): Act in accordance with the `act' field if the
	component terminates.
	(progman_stop_component,progman_dump_stats): Take into account
	prog->v.p.status.
	* pies/pies.h (MAX_RETURN_CODE): New define.
	(enum return_action): New type.
	(struct component.act): New member.
	(default_component): New global.

2008-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c: Fix handling of the --log-tag option.

	* pies/progman.c (prog_start): Remove unconditional debugging
	output.

2008-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (log_setup): Always set mu_debug_default_printer to
	override bug in libmailutils.
	(component_cfg_param): New keyword `env'.
	(main): Bugfix: It is -R that allows arguments, not -r.
	* pies/progman.c (struct prog): New member env.
	(register_prog): Avoid unnecessary allocations. Copy env.
	(env_setup): New function.
	(prog_start): Set up environment.
	* pies/pies.h (struct component): New member env.

2008-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c, pies/progman.c,
	pies/pies.h, pmult/pmult.c: Sync with MU CVS: Use mu_log_facility
	and mu_log_tag.

2008-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	* pies/pies.c (_cb_group): Bugfix: store group number in the list,
	not its name.
	(component_section_parser): Initialize retr to default values.
	* pies/Makefile.am (LDADD): Place libgnu.a after
	MAILUTILS_LIBS. 
	
	* pies: New directory.
	* pies/Makefile.am: New file.
	* pies/pies.c, pies/progman.c, pies/pies.h, pies/pies.rcin: New
	files.

Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End:

 This file is part of GNU Pies.
 Copyright (C) 2008, 2009 Sergey Poznyakoff

 GNU Pies is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3, or (at your option)
 any later version.

 GNU Pies is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with GNU Pies.  If not, see <http://www.gnu.org/licenses/>.
