2016-10-01  Sergey Poznyakoff  <gray@gnu.org>

	Version 1.3

2016-08-20  Sergey Poznyakoff  <gray@gnu.org>

	Fix environment modification code

	Port fixes from GNU rush

2016-07-16  Sergey Poznyakoff  <gray@gnu.org>

	Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/pies

	Don't concatenate adjacent strings in configuration files.

	* grecs: Upgrade.
	* src/pies.h: Fix include paths.
	* src/piesctl.c: Likewise.

	* NEWS: Document changes.
	* doc/pies.texi: Likewise.

2016-04-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove duplicate includes

2016-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix

	* lib/split3.c: Return correct error code.

2016-03-19  Sergey Poznyakoff  <gray@gnu.org>

	Add testsute

	Bugfixes

	* src/pies.c (main): Issue the start-up message after eventual changing
	to background and the corresponding reconfiguration of diagnostic output
	channel.
	* src/piesctl.c (parse_condition_to_uri, com_id): Fix checking for arguments.

2016-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix some compilation issues on Solaris

	* configure.ac: Check for libnsl
	* src/pies.c (string_to_syslog_facility): LOG_AUTHPRIV and LOG_FTP
	may be undefined.
	* src/piesctl.c (EX_NOTFOUND): Rename to EX_PIES_NOTFOUND.
	(com_list): Use default_cond.
	* src/sysvinit.c (console_stty): Make sure CBAUDEX is defined.
	* src/utmp.c (fill_utmp): Declare locals right before using them.

2016-03-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	version 1.2.94

	Update NEWS and README

2016-03-12  Sergey Poznyakoff  <gray@gnu.org>

	Spell-check

2016-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve docs

	* doc/pies.texi: Document piesctl and identity providers.
	* src/piesctl.c: Fix reference to the docs.

	Fix pies -E

	* src/pies.c (main): Fix syntax type comparison.

2016-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Reimplement the telinit legacy interface.

	pies -T is now fully compatible with the legacy telinit command

	* src/telinit.opt: New file.
	* src/Makefile.am: Add telinit.opt
	* src/cmdline.opt (-T): Remove explicit variable.  Rest of
	command line is processed specially.
	* src/pies.h (telinit): Change prototype.
	* src/sysvinit.c (telinit): Rewrite.
	* src/.gitignore: Update.
	* doc/pies.texi: Document telinit.

2016-03-05  Sergey Poznyakoff  <gray@gnu.org>

	ACL reference statements.

	All ACL keywords can be used in simple statement as well as in block form.
	As simple statements, they take a name of an already defined named ACL. E.g.:

	  defacl forbid {
		deny any;
	  }

	  component foo {
	    list-acl forbid;
	  }

	This commit also fixes some eventual double-frees.

	* doc/pies.texi: Update.
	* src/acl.c (pies_acl)<refcnt>: New member.
	(pies_acl_use): New function.
	(pies_acl_create): Initialize refcnt.
	(pies_acl_destroy): New function.
	(pies_acl_free): Rewrite as a wrapper over pies_acl_destroy.
	(_parse_sub_acl): Call pies_acl_use when installing a named ACL.
	(_acl_common_section_parser): Handle grecs_callback_set_value.
	* src/acl.h (pies_acl_destroy)
	(pies_acl_use): New function.
	* src/comp.c (component_free): Free acl.

	Use pies_schedule_action instead of assigning action directly.

2016-03-02  Sergey Poznyakoff  <gray@gnu.org>

	Improve docs

	Bugfixes

	* src/comp.c (component_verify): Fix stdout redirection check.
	* src/meta1parse.c (meta1_translate_node): Skip simple statements.
	(meta1_translate_node): Allocate comp->dir
	* doc/pies.texi: Use @example instead of @smallexample

	Configurable pathname of the emergency shell

	* configure.ac (EMERGENCY_SHELL): New arg_var.
	* src/Makefile.am (AM_CPPFLAGS): Define EMERGENCY_SHELL.
	* src/sysvinit.c (emergency_shell): Initialize with the
	value of EMERGENCY_SHELL.

2016-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve documentation

	* doc/Makefile.am (check-sub-config): Fix regexps.
	* doc/pies.texi: Document init operation.

	Bugfix

	* src/sysvinit.c (sysvinit_environ_hint): Fix dimensions.

2016-02-28  Sergey Poznyakoff  <gray@gnu.org>

	Synchronize changes in runlevel with configuration reloads

	State transition algorithm used this far could cause spurious component
	wakeups in some cases.  Consider the following scenario: being in
	runlevel N, the configuration is changed so that a component X is added
	at runlevel N.  Then a change to runlevel N+1 is initiated.  What happens
	then is that X is woken up (still being in runlevel N) and terminated
	shortly afterwards, upon entering runlevel N+1.

	To avoid this, configuration must be reloaded after runlevel changes.

	* src/ctl.c (res_runlevel): Don't initiate ACTION_RELOAD after
	setting the runlevel.
	* src/pies.c (main): Begin main event loop with call
	to pies_pause.
	* src/pies.h (pies_set_hook): New proto.
	(inittrans): Remove proto.
	* src/socket.c  (pies_set_hook): New function.
	(pies_pause): Call pies_pause_hook if defined.
	* src/sysvinit.c (inittrans): Change to static.
	If transition was initiated by user (e.g. by invoking telinit),
	schedule ACTION_RELOAD.
	(sysvinit_begin): Set inittrans as pies_hook

	Minor change

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

	Minor fix

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

	piesctl: minor formatting change

	Improve previous commit.

	* comp.c (mark_prog): Instead of calling progman_gc, terminate the
	prog if it is a deactivated listener.

	Fix reconfiguration code

	* src/comp.c (component_config_commit): Run progman_gc right
	after mark stage, to ensure any eventual listener components
	are properly closed before being reopened by progman_create_sockets

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

	Enable the use of redirectors in init mode

2016-02-25  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix

2016-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement "telinit environ" ctl command

	* src/ctl.c: New endpoint "environ"
	* src/pies.h (sysvinit_envlocate)
	(sysvinit_envdelete)
	(sysvinit_envupdate): New protos.
	* src/piesctl.c: New subcommand "telinit environ".
	* src/sysvinit.c (sysvinit_envlocate)
	(sysvinit_envdelete)
	(sysvinit_envupdate): New functions.
	(sysvinit_begin): Create allocated copies of
	instance and pies_master_argv to avoid them being
	rewritten by calls to mf_proctitle_format

2016-02-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve parsing and handling of stop, start, and restart ctl commands.

	* src/ctl.c (pcond_active): New type.
	(pcond_eval): Handle pcond_active.
	(pcond_conv): New op: active.
	(pcond_conv_find): Skip array elements with NULL term value.
	(object_to_cond): Permit empty argument if no
	handler function is defined.
	(fun_stop): Work on all prog types.
	(fun_start): Work only on components.
	(fun_restart): Work only on running components.
	* src/piesctl.c (cmdline_parser_state): New member: command.
	(pcond_parse_unary): Handle "active" keyword.
	(parse_condition): Change signature.
	(parse_condition_to_uri): Likewise.
	(default_cond): New function,
	(com_stop, com_start, com_restart): If no arguments supplied,
	assume default condition "type component".
	(ctlcom_t): Change signature.  All uses changed.
	(main): Pass a pointer to cmdline_parser_state to the
	command handler.

	Changes in prog structure

	* src/prog.h (prog): Remove .facility.  Use facility from
	the component.
	(active,wait,stop): Move from union into the main struct.
	All uses changed.

	Cleanup initialization code

	* src/cmdline.opt (parse_options): Change signature.
	Handle sysvinit case.
	* src/pies.c (set_conf_file_names): Handle sysvinit case.
	(main): Move some parts of sysvinit-specific initialization
	to set_conf_file_names.

2016-02-24  Sergey Poznyakoff  <gray@gnu.org>

	Remove spurious informational message on startup

	Minor stylistic change

	Version 1.2.93

2016-02-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes

	* lib/addrfmt.c: Include limits.h
	* src/ctl.c (fun_stop,fun_start): Ignore non-component
	progs.
	* src/pies.c (request_restart_components): Fix piesctl
	invocation.
	* src/pies.h (PIES_CHLD_RESCHEDULE_ALARM): New flag.
	(progman_wait_until): Remove.
	(progman_recompute_alarm): New proto.
	* src/progman.c (recompute_alarm): Remove. All uses
	raise PIES_CHLD_RESCHEDULE_ALARM instead.
	(progman_wake_sleeping): Handle status_stopping components
	independently on their activity flag.
	(prog_stop_all, progman_wait_until): Remove.
	(progman_stop): Rewrite using mark+sweep approach.

	Improve logging

	* po/POTFILES.in: Add missing source files.
	* grecs: Upgrade.
	* src/diag.c (pies_diag_printer): New function.
	(logfuncall): New function.
	* src/pies.h: Add new prototypes.
	* src/pies.c (main): Initialize grecs_print_diag_fun
	* src/acl.c: Uniformly use double-quotes in messages.  Use
	logfuncall where applicable.
	* src/comp.c: Likewise.
	* src/ctl.c: Likewise.
	* src/inetd-bi.c: Likewise.
	* src/inetd.c: Likewise.
	* src/limits.c: Likewise.
	* src/piesctl.c: Likewise.
	* src/progman.c: Likewise.
	* src/socket.c: Likewise.
	* src/sysvinit.c: Likewise.

2016-02-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Get rid of progman_iterate_comp

	* src/inetd-bi.c (tcpmux): Use component_foreach to
	handle help requests.
	* src/progman.c (progman_iterate_comp): Removed.
	* src/pies.h: Likewise.

	Provide a default single-user entry in init mode

	This complements 6aac230c. The entry is created unless
	a component for runlevel S already exists.

	* src/comp.c (component_foreach): New function.
	* src/pies.h: Likewise.
	* src/sysvinit.c (inittab_parse): Provide default S
	entry unless one is already defined.

2016-02-21  Sergey Poznyakoff  <gray@gnu.org>

	Fix dereferencing of freed memory.

	Improper dereferencing occurred when trying to access master
	prog of a redirector.

	* src/prog.h (prog) <r.comp>: New member.
	* src/progman.c (destroy_prog) <TYPE_COMPONENT>: Clear master
	pointers in both redirectors.
	<TYPE_REDIRECTOR>: Check if master is NULL.
	(register_redir): Initialize r.comp.

	Fix memory leaks

	Fix memory leaks when reconfiguring

	* grecs: Upgrade.
	* src/acl.c (_acl_common_section_parser): Free old value.
	* src/pies.c: Mark statically initialized keywords with
	GRECS_CONST.

	Bugfixes.

	* src/pies.c (_cb_command,_cb_env): Free wordsplit struct.
	(main): Allocate log_tag.  Otherwise it might get overwritten
	by mf_proctitle_format.

	Provide fall-back entry in init mode

	* src/sysvinit.c (inittab_parse): Provide default entry if
	inittab cannot be read or if it defined no components.
	* src/comp.c (component_list_is_empty): New function.
	* src/pies.c (pies_read_config): Always return 0 in init mode.
	(main): Use LOG_DAEMON in init mode.
	* src/pies.h (component_list_is_empty): New proto.

	Bugfix

	* src/comp.c (component_config_commit): Correctly handle
	empty list of components.

2016-02-20  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix

	* src/pies.c (main): Use pies_master_argv when restarting.

2016-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve control interface

	This commit implements the following operations on the new /conf endpoints:

	  GET /conf/runtime     -     List configuration
	  PUT /conf/runtime     -     Reload configuration
	  POST /conf/runtime    -     Post new configuration

	  GET /conf/files       -     List configuration files
	  DELETE /conf/files    -     Delete some or all configuration files
	                              from the list
	  POST /conf/files      -     Install new configuration file

	Piesctl supports the following new commands:

	  piesctl config reload
	  piesctl config file clear
	  piesctl config file add SYNTAX NAME
	  piesctl config file del[ete] NAME [NAME...]
	  piesctl config file list

	* src/ctl.c (res_conf): New function.
	(restab): New endpoint /conf
	* src/pies.c (config_file_add): Set free_entry.
	(config_file_remove, config_file_remove_all)
	(config_file_list_serialize): New functions.
	(pies_config_parse): Bail out if tree processing fails.
	(pies_reload): Remove unused function.
	(main): Redo ACTION_RELOAD handling.
	Handle ACTION_COMMIT.
	* src/pies.h (ACTION_COMMIT): New action.
	(config_file_remove, config_file_remove_all)
	(config_file_list_serialize)
	(pies_read_config, progman_gc): New protos.
	* src/piesctl.c (cmdline_parser_state): New struct
	(next_token, peek_token): Take ptr to cmdline_parser_state as argument.
	(parse_error, require_token, assert_eol)
	(piesctl_format): New functions.
	(parse_condition_to_uri): Rewrite using piesctl_format.
	New subcommand: config.
	Improve help output.

2016-02-19  Sergey Poznyakoff  <gray@gnu.org>

	Revamp program termination after reconfiguring.

	* src/pies.h (PIES_CHLD_GC): New op.
	(progman_stop_tag): Remove proto.
	* src/pies.c (main): Handle PIES_CHLD_GC: stop all programs marked
	for termination.
	* src/comp.c (component_config_commit): Mark leftover components
	for termination, instead of waiting for them to terminate.
	* src/sysvinit.c (runlevel_setup_prog): Skip prog if its
	active status didn't change.
	Mark inactivated progs for termination.
	(sysvinit_runlevel_setup): Schedule PIES_CHLD_GC.
	(inittrans): Don't wait for programs to terminate. That will be done
	in the main loop.
	* src/prog.h (prog)<stop>: New boolean member.
	* src/progman.c (progman_cleanup)
	(progman_stop_component): Clear the stop flag.
	(progman_gc): New function.
	(progman_stop_tag): Remove.

2016-02-18  Sergey Poznyakoff  <gray@gnu.org>

	Preserve the order of progs when adding new ones.

	* src/progman.c (link_prog): Take a pointer to the reference prog
	as the second argument.  Link the first argument after that reference
	prog, or at the head of the list if the reference is NULL.
	(register_prog0): Make sure progs are linked exactly in the same order
	as the corresponding components.
	(prog_create_socket): Process only progs with status == status_listener
	(progman_start): Do the right thing depending on the prog type.

	Fix activation/deactivation of network listeners.

	* src/ctl.c (prog_active): New function.
	(prog_serialize): Use prog_active to report prog's activity state.
	For listener components, return also their service and tcpmux master
	names, if applicable.
	(fun_stop): Stop listeners as well.
	(fun_start): Start listeners.
	(ctlio_end): Don't close fd: this is done by deregister_socket
	* src/inetd-bi.c (tcpmux_help): Don't list inactive components.
	* src/prog.h (prog_activate_listener)
	(prog_deactivate_listener): New protos.
	* src/progman.c (prog_lookup_by_tag)
	(prog_lookup_by_service): Remove.
	(progman_cleanup): Fix coredump (premature free).
	(progman_stop_component): If component is a listener, deactivate it.
	(prog_activate_listener)
	(prog_deactivate_listener): New functions.
	* src/socket.c (delete_sockinst): Close the socket descriptor.
	* src/sysvinit.c (sysvinit_fifo_handler, create_fifo): Don't close fd,
	leave that to deregister_socket.

	Improve logging

	* src/diag.c: Rewrite.
	(vdiagmsg,diagmsg): New functions.
	* src/pies.c (main): Set DIAG_REOPEN_LOG for init process.
	* src/pies.h (DIAG_REOPEN_LOG): New flag
	(DIAG_TO_MASK,DIAG_ALL): New constants.
	(diagmsg): New proto.
	* src/sysvinit.c: Add log messages in important transition points
	(inittrans): Reinitialize logging to syslog upon transition to
	normal mode.

2016-02-17  Sergey Poznyakoff  <gray@gnu.org>

	Fix state transitions

	* src/pies.c (main): Move call to pies_schedule_children
	to inittrans.
	* src/progman.c (progman_cleanup): Minor change.
	* src/sysvinit.c (enablecomp): Change prog status
	to stopped when leaving its runlevel.
	(sysvinit_set_runlevel): Raise SIGALRM instead of calling
	inittrans directly.
	(inittrans): Fix wait logic.

2016-02-16  Sergey Poznyakoff  <gray@gnu.org>

	Associate program's activity flag with prog, instead of with component.

	The CF_DISABLED flag is still retained to indicate that the component is
	disabled administratively.

	* src/prog.h (prog.v.p) <active>: New member.
	(IS_ACTIVE_COMPONENT): Use active flag.
	* src/comp.c (component_finish): Don't modify component flags.
	* src/ctl.c (prog_serialize): Replace attribute "disabled" with
	"active".
	(fun_stop): Set prog->v.p.active
	* src/pies.c (main): Use pies_master_argv to check whether
	program name is absolute.
	* src/piesctl.c (print_comp): Check "active" attribute.
	* src/progman.c (register_prog0): Set prog->v.p.active.
	(progman_create_sockets): Remove components if their
	socket cannot be opened.
	(progman_lookup_tcpmux, prog_open_socket)
	(prog_start, progman_start)
	(prog_start_prerequisites, react): Operate on prog->v.p.active
	to test/change prog's activity state.
	* src/sysvinit.c (enablecomp, runlevel_setup_prog): Operate on
	prog->v.p.active to test/change prog's activity state.
	(demand_prog, IS_RUNNING_DISABLED_PROG): Likewise.

2016-02-15  Sergey Poznyakoff  <gray@gnu.org>

	Implement emergency shell.

	* src/pies.c (main): Move init-specific command line
	handling to sysvinit_parse_argv.
	* src/pies.h (dfl_level): Remove extern.
	(sysvinit_parse_argv): New proto.
	* src/sysvinit.c (sysvinit_parse_argv): New function.
	(sysvinit_begin): Start emergency shell, if requested.

2016-02-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix handling of wait components

	* src/pies.h (PIES_COMP_WAIT): Remove.
	(PIES_COMP_MASK): Save one bit.
	(PIES_CHLD_NONE, PIES_CHLD_CLEANUP)
	(PIES_CHLD_WAKEUP): New constants.
	(pies_schedule_children): New proto.
	(sysvinit_runlevel_setup): Change signature.
	* src/pies.c (children_cleanup, got_alarm): Merge into
	single static variable children_op. All uses updated.
	(pies_schedule_children): New function.
	(sig_handler): Update
	(main): Don't call ctl_open for init process.  It is done
	by inittrans after transition from boot to normal state.
	Update to use pies_schedule_children.
	* src/prog.h (IS_ACTIVE_COMPONENT): New macro.
	* src/progman.c (prog_start): Don't modify prog->v.p.wait.
	(progman_wake_sleeping): Start usual components only after
	all "wait" components have terminated.
	(progman_cleanup): If a "wait" component has terminated,
	request PIES_CHLD_WAKEUP.
	* src/sysvinit.c (enstate) <wait>: Remove.
	(enablecomp): Update.
	(runlevel_setup_prog): Set prog->v.p.wait.
	(sysvinit_runlevel_setup): Take only one parameter.
	(inittrans): Remove "wait" and the related mess.
	Call ctl_open after transition boot -> normal.

2016-02-13  Sergey Poznyakoff  <gray@gnu.org>

	Stop disabled components when switching runlevels.

	* src/prog.h (status_enabled, status_disabled): Remove.
	(status_stopped, status_running): New modes.
	All uses updated.
	* src/comp.c (component_finish): Disable ondemand component
	by default.
	* src/ctl.c (json_object_set_bool): New function.
	(pies_status_str): Update.
	(prog_serialize): Set "disabled" attribute.
	(fun_stop, fun_start): Use CF_DISABLED flag.
	(res_runlevel): Schedule ACTION_RELOAD.
	* src/pies.h (json_object_set_bool): New proto.
	* src/piesctl.c (status_trans): Reflect changes in modes.
	(print_comp): Check the "disabled" attribute.
	* src/progman.c (register_prog0)
	(prog_open_socket,prog_start,prog_stop)
	(progman_wake_sleeping)
	(prog_start_prerequisites)
	(react, progman_cleanup)
	(progman_stop_component): Update.
	(no_children_left): Fix.
	* src/sysvinit.c (enablecomp): Make CF_DISABLED flag
	persist for ondemand components.
	(runlevel_setup_prog): Use CF_DISABLED flag.
	(inittrans): Stop inactivated processes.

	* doc/pies.texi: Update.

	Implement on-demaind components; implement control socket telinit interface.

	* src/pies.h: Include json.h
	(sysvinit_report, sysvinit_set_runlevel)
	(json_object_set_string, json_object_set_number): New protos.
	* src/ctl.c (ctlio_resource)<predicate>: New member.
	(restab): New endpoint: runlevel.  Available only if run
	as pid 1.
	(find_resource): If predicate is not NULL, call it to
	confirm that the endpoint is available.
	* src/piesctl.c: New subcommand "telinit".
	* src/sysvinit.c (sysvinit_set_runlevel): New function.
	(sysvinit_fifo_handler): Implement on-demaind components.

	Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/pies

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

	Improve progman API (progman_foreach and progman_stop_component).

	* src/progman.c (progman_foreach): Allow filter to remove its prog
	argument from the list.  Return integer (result of the call
	to filter, that returned non-zero).  All uses changed.
	(progman_running_count): Remove.
	(progman_stop_component): Take a pointer to
	pointer.  Pass it to destroy_prog when needed.  All uses changed.
	* src/comp.c (prog_is_leftover): New function.
	(cb_terminate_prog): Use prog_is_leftover. Don't raise CF_DISABLED
	flag, as prog will have been destroyed by progman_stop_component.
	(cb_kill_prog): Use prog_is_leftover.
	* src/ctl.c (fun_stop): Check if prog still exists after the
	call to progman_stop_component.
	* src/pies.h (progman_running_count): Removed.
	* src/prog.h (progman_foreach): Return int.
	(progman_stop_component): Change signature.

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

	Update POTFILES.in

	Support sysvinit ondemand components.

	* src/ctl.c (fun_start): Handle status_finished same as
	status_sleeping (for restarting ondemand components).
	* src/progman.c: Respawn ondemand components.
	* src/sysvinit.c (enablecomp): Handle pies_comp_ondemand.
	(sysvinit_demand): New function.
	(sysvinit_fifo_handler): Handle ondemand runlevels.
	(inittab_parse): Support "off" fields.
	Convert runlevels to upper case.

	Fix runlevel switching; handle powerfail commands.

	* src/ctl.c (prog_serialize): List runlevels.
	* src/pies.c (main): Set got_alarm after reloading configuration.
	Handle ACTION_POWER.
	* src/pies.h (ACTION_POWER): New constant.
	(progman_running_p): Rename to progman_waiting_p. All uses changed.
	(sysvinit_power): New proto.
	(POWER_STAT_FILE): New define.
	(POWER_STAT_FAIL,POWER_STAT_LOW,POWER_STAT_OK): New constants.
	* src/prog.h (prog) <idx>: Remove.
	(prog) <wait>: New member.
	* src/progman.c (prog_lookup_by_idx): Remove.
	(progman_waiting_p): Return 1 only if there is at least one
	prog with v.p.wait set.
	(prog_start): Initialize v.p.wait for sysvinit components.
	(progman_start): Don't do anything if waiting for components from
	the previous runlevel.
	(progman_wake_sleeping): Likewise.
	(progman_cleanup): Assume expect_term if waiting for components from
	the previous runlevel.
	Clear v.p.wait on exited progs.
	* src/sysvinit.c (sysvinit_fifo_handler): Don't call progman_stop
	when handling runlevel changes.
	Handle INIT_CMD_POWERFAIL, INIT_CMD_POWERFAILNOW, and
	INIT_CMD_POWEROK.
	(sysvinit_sigtrans): Handle SIGPWR.
	(is_comp_wait): Rewrite.
	(power_stat_file): New variable.
	(sysvinit_power): New function.

2016-01-30  Sergey Poznyakoff  <gray@gnu.org>

	Fix configuration reload and telinit q

	* src/comp.c (component_link): Always link after the REF.
	component. If REF is NULL, link at list head.
	(component_append): New function.
	(component_create): Use component_append.
	(component_free): Fix double-free.
	* src/pies.c (pies_reload): Call sysvinit_runlevel_setup.
	* src/progman.c (progman_stop_component): Remove inactive
	components.
	* src/sysvinit.c (sysvinit_fifo_handler): Schedule ACTION_RELOAD.
	on receiving INIT_CMD_RUNLVL.
	(sysvinit_sigtrans): Don't handle SIGHUP.

2016-01-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix grecs version

	Bugfix

	* src/comp.c (component_link): Restore "next" link.

2016-01-21  Sergey Poznyakoff  <gray@gnu.org>

	Cleanup: redo configuration file handling and dependency tracking.

	Implement clean configuration reload on SIGHUP.
	Use SIGUSR1 to restart the program (previously initiated by SIGHUP).

	* src/Makefile.am (pies_SOURCES): Add comp.c
	* src/comp.c: New file.
	* src/acl.c (pies_acl_free): Don't coredump on NULL arg.
	(_parse_from): Set cmp function for the sockaddr list.
	(_acl_common_section_parser): Set cmp function for the ACL
	(pies_acl_cmp): New function.
	* src/acl.h (pies_acl_cmp): New proto.
	* src/cmdline.opt: Remove option --dump-prereq. Add options
	--trace-prereq and --trace-depend.
	* src/ctl.c: Use prog_tag to access tag of struct prog.
	* src/depmap.c (depmap_clear)
	(depmap_clear_all): New functions.
	* src/inetd.c (inetd_conf_file): Don't register prog right
	away.  This is done later in component_config_commit.
	(inetd_parse_conf): Rename to inetd_config_parse.
	* src/limits.c (limits_cmp): New function.
	* src/pies.c (config_file): Replace with struct config_syntax.
	(str_to_config_syntax): Return a pointer to struct config_syntax.
	(add_config): Rename to config_file_add.
	(config_file_add_type): New function.
	(return_code_keywords, create_action): Change handling of actions.
	(return_code_section_parser): Likewise.
	(component_verify, component_create)
	(component_free, component_finish): Move to comp.c
	(config_parse): Remove.
	(pies_config_parse): New function.
	(pies_read_config,pies_reload): New function.
	(pies_reload): Rename to request_reload.
	(pies_status): Rename to request_status.
	(pies_stop): Rename to request_stop.
	(main): Change configuration file handling.
	SIGHUP reloads configuration, instead of restarting the program.
	(default_sigv,sig_handler): Handle SIGUSR1.
	* src/pies.h (component): New members: prev, next, listidx, arridx,
	ref_count, prog.
	Remove act_head, act_tail, act_temp.
	Add new prototypes.
	* src/prog.h (prog): Remove tag and prereq.
	* src/progman.c (prog_tag): New function.
	(destroy_prog): Update component reference count.
	(register_redir): Likewise.
	(register_prog0): Take one argument.
	Update component reference count.
	(register_prog): Update comp->prog
	(prog_rebuild_prerequisites): Remove.
	(component_fixup_depend): Remove.
	(fixup_prerequisites,rebuild_prerequisites)
	(print_dep,progman_dump_prereq)
	(progman_dump_depmap,progman_build_depmap): Remove.
	(prog_start_prerequisites): Scan depmap to find prerequisites.
	(prog_stop_dependents): Likewise.
	(progman_wait): Remove.
	(progman_wait_until): New function.
	(progman_stop): Rewrite using progman_wait_until.
	(react): Rewrite using grecs_list
	* src/sysvinit.c: Use prog_tag when needed.
	* src/userprivs.c (pies_privs_cmp, pies_privs_free): New functions.

	* grecs: Update.

	* lib/safe_strcmp.c: New file.
	* lib/Makefile.am: Add safe_strcmp.c
	* lib/libpies.h (safe_strcmp): New proto.

2016-01-10  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes in message wording

	Improvements in init mode

	* src/progman.c (print_status): Suppress output if running
	as init process, unless in debug mode.
	* src/sysvinit.c (sysvinit_begin): Set up "non-failing"
	memory allocation.

2016-01-09  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix

	Minor improvements

	* src/ctl.c (ctl_open): Return immediately if
	control.url is null.
	(fun_start): Start sleeping component.
	* src/meta1lex.h: Removed.
	* src/pies.c (config_parse): Move creation of the default
	control.url to main.

	Update POTFILES.in

	Use grecs meta1 parser

	* configure.ac (GRECS_SETUP): Require parser-meta1
	* grecs: Upgrade.
	* po/POTFILES.in: Update.
	* src/Makefile.am: Remove meta1gram.y and meta1lex.l
	Add meta1parse.c and meta1parse.h
	* src/meta1gram.y: Remove.
	* src/meta1lex.l: Remove.
	* src/meta1parse.c: New file.
	* src/meta1parse.h: New file.
	* src/pies.c: Include meta1parse.h instead of meta1lex.h

	Bugfixes

	* src/meta1gram.y: Translate "wait" mode to "exec".
	* src/diag.c (logmsg_vprintf): Don't loose the last segment before \n.

	piesctl: optionally bind to local IP

	* configure.ac (GRECS_SETUP): Request sockaddr-list
	* grecs: Upgrade.
	* po/POTFILES.in: Remove meta.c
	* src/piesctl-cl.opt: Use client.url
	* src/piesctl.c (client_conn): New struct.
	(instance_keywords,piesctl_keywords): New keyword: "source".
	(parse_config): Initialize grecs_sockaddr_hints.
	(shttp_connect): Optionally bind to the selected local IP
	before connecting.

	* src/utmp.c (write_wtmpx,write_utmpx): Remove spurious notice.

2016-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Uniformly use grecs memory management functions.

	* gnulib.modules: Remove unneded modules.
	* ident/ident.h: Remove xalloc.h, include errno.h
	* ident/ident.c: Use standard allocation functions instead of x*
	* ident/pam.c: Remove.
	* ident/provider.c: Remove.
	* ident/system.c: Remove.

	* src/meta.c: Remove.
	* src/Makefile.am: Remove meta.c
	* src/progman.c: Use grecs_* allocation functions instead of x*.
	(notify): Use wordsplit to expand variables within message.
	Rename variables: program-name to program_name;
	canonical-program-name to canonical_program_name.

	* doc/pies.texi: Update.

	* src/depmap.c: Use grecs_* allocation functions instead of x*.
	(depmap_end): New function.

	* src/diag.c (logmsg_vprintf): Use grecs_txtacc instead of obstack.
	* src/pies.h (depmap_end): New proto.
	Remove unused includes.

	* src/acl.c: Use grecs_* allocation functions instead of x*.
	* src/ctl.c: Likewise.
	* src/inetd.c: Likewise.
	* src/limits.c: Likewise.
	* src/meta1gram.y: Likewise.
	* src/meta1lex.l: Likewise.
	* src/pies.c: Likewise.
	* src/socket.c: Likewise.
	* src/sysvinit.c: Likewise.
	* src/userprivs.c: Likewise.

	Enable control socket when run as init process.

	* configure.ac (DEFAULT_CONTROL_URL): Rename to
	DEFAULT_PIES_CONTROL_URL.  Change default value.
	(DEFAULT_INIT_CONTROL_URL): New subst variable.
	* lib/libpies.h (pies_basic_url_create): New prototype.
	* lib/url.c (pies_basic_url_create): New function (renamed
	from pies_url_create).
	(pies_url_create): Expand variable references in the input string.
	* src/Makefile.am (AM_CPPFLAGS): Pass DEFAULT_INIT_CONTROL_URL
	* src/ctl.c (pies_control_url)
	(ctl_open): Don't exit on errors, return -1 instead.
	* src/pies.c (default_control_url): New variable.
	(config_parse): Create default socket url.
	(pies_control_url): New macro
	(main): Set environment variable PIES_INSTANCE.
	Try to open control socket in init process mode as well.
	* src/pies.h (default_control_url): New extern.
	(ctl_open): Change prototype.
	(pies_control_url): Remove.
	* src/piesctl-cl.opt (parse_options): Set environment variable
	 PIES_INSTANCE.
	* src/piesctl.c (parse_config): Use pies_url_create and
	DEFAULT_PIES_CONTROL_URL when falling back to the default socket.

	Bugfix

	* lib/addrfmt.c (S_UN_NAME): Fix comparison.
	(sockaddr_to_str): Improve wording.

2016-01-08  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes

	* bootstrap.conf (bootstrap_epilogue): Declare the package as a
	GNU one.
	* configure.ac: Require gettext 0.19
	Remove useless conditional
	* src/ctl.c (fun_stop, fun_start): Check prog->v.p.status, not the
	CF_DISABLED flag.

2016-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revert to pre-32a337f3 two endpoint system

2016-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	control interface: pass JSON as query for GET, DELETE, and PUT

	piesctl: normalize exit codes.

	* src/piesctl.c (EX_OK, EX_NOTFOUND): New defines.
	(exit_status): New global.
	(all calls): Use EX_OK instead of literal 0
	(shttp_process): Set exit_status on errors.
	(com_list, com_id): Return void.  Check response code.
	(com_stop, com_start)
	(com_restart, com_reboot): Return void.
	(ctlcom_t): Return void.
	(main): Return exit_status

	Include argv in the output of ctl id command.

	* ctl.c (res_instance): Include "argv" in the return json.
	Use pies_master_argv[0] to report binary path.
	* pies.c (pies_master_argv,pies_master_argc): New globals.
	(main): Initialize them.
	Refuse to restart unless argv[0] begins with a slash.
	* pies.h (pies_master_argv,pies_master_argc): New globals.
	* piesctl.c (com_id): Rewrite output formatting.

	Minor changes.

	* src/ctl.c (ctlio_authenticate): Configurable realm name.
	(ctlio_do_command): Check the Accept header.
	* src/inetd.c (inetd_conf_file): Change line_no type.
	* src/pies.c (control_keywords): New keyword: realm.
	* src/pies.h (control) <realm>: New member.

	Insert missing _() markers

	Select components to operate upon using conditional expression

	* grecs: Upgrade.
	* src/ctl.c (restab): Split /programs in two endpoints.
	(eval_env): New members allowed_state, fun, total_count,
	success_count, and noperm_count.
	(pcond_type): pcond_and and pcond_or can take arbitrary
	number of arguments.  All uses updated.
	(selector): Rewrite.
	* src/piesctl.c: All commands that operate on components take
	conditional expression as argument.
	(pcond_parse_and)
	(pcond_parse_or): Optimize consecutive operations.

2016-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Redo URI handling.

	* src/ctl.c (res_instance)
	(res_programs): Take partial URI as argument (instead of full
	URI split on path delimiter)
	(ctlio_resource): New member uri_len; Change signature of handler.
	(find_resource): Compare URI prefix.
	(ctlio_do_command): Redo URI parsing. Improve error checking.
	* src/piesctl.c (shttp_print_error): New function.
	(shttp_fatal): Print error on 404 and 409 responses.

	Minor fixes

	* src/ctl.c: Start textual descriptions with capital letters.
	* src/piesctl-cl.opt: Fix typos.
	* src/piesctl.c (shttp_process): Fix error handling.
	(shttp_fatal): Select exit code depending on the HTTP response code.

2016-01-04  Sergey Poznyakoff  <gray@gnu.org>

	Improve piesctl help output

	* src/piesctl.c (comtab): New members: argdoc and docstr.
	(command_help): New function.
	(main): Set proginfo.print_help_hook
	* po/POTFILES.in: add missing files.

2016-01-03  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes

	Minor changes

	* configure.ac: Version 1.2.92
	* src/ctl.c (ctlio_finalize_reply): Don't close connection on errors.
	* src/pies.h (PIES_PRINTFLIKE): New macro.
	(logmsg, logmsg_printf): Mark as printflike.

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

	Switch to new control interface.

	Old control options (--status, --restart-components) rewritten using
	piesctl.

	SIGUSR1 and SIGUSR2 no longer handled.

	* lib/arraymember.c (array_index): New function.
	* lib/libpies.h: Likewise.
	* src/cmdline.opt: Fix copyright years.
	* src/piesctl-cl.opt: Likewise.
	* src/ctl.c (ctlio_do_command): Implement restart.
	(pies_control_url): New function.
	(eval_env): rename json to result.
	New member cond.
	Restore pcond_ functions.
	(json_to_pcond): New function.
	(res_programs): Conditional selection of programs to list.
	Implement restart.
	* src/pies.c (ctlfile, statfile): Remove.
	(pies_keywords): Mark control-file and stat-file as inactive.
	(default_sigv): Remove SIGUSR1 and SIGUSR2
	(pies_check_status): Don't send SIGUSR2.
	(stop_components): Remove.
	(request_restart_components): Rewrite as a wrapper.
	Call piesctl to do the job.
	(list_components): New function.
	* src/pies.h (ACTION_COMPRELOAD)
	(ACTION_DUMPSTATS): Remove. All callers changed.
	(progman_dump_stats): Remove.
	* src/piesctl.c (shttp_request_send): Don't initialize conn->req; the
	caller is responsible for that.
	(parse_condition, json_to_string)
	(parse_condition_to_uri): New functions.
	(com_list): Read conditional expression from the command line.
	(com_restart): Implement.
	* src/progman.c (progman_dump_stats): Remove.

	piesctl: Implement all basic commands, except "restart"

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

	Command-line control interface.

	* configure.ac (DEFAULT_CONTROL_URL): New subst variable.
	* grecs: Upgrade.
	* ident/pam.c (overwrite_and_free): Free ptr.
	* lib/Makefile.am: Add new sources.
	* src/addrfmt.c: Move to lib/addrfmt.c
	* lib/grecsasrt.c: New file.
	* lib/grecsasrt.h: New file.
	* lib/mkfilename.c: New file.
	* lib/netrc.c: New file.
	* lib/pp.c: New file.
	* lib/split3.c: New file.
	* src/url.c: Move from lib/url.c
	(pies_url_free_user, pies_url_free_passwd): New finctions.
	* lib/libpies.h (strsplit3): New proto.
	(pies_url_create, pies_url_destroy)
	(pies_url_get_arg, pies_url_copy)
	(pies_url_free_user, pies_url_free_passwd)
	(netrc_scan)
	(pp_add_option, pp_command_line, mkfilename)
	(sockaddr_to_str, sockaddr_to_astr): New protos
	* src/Makefile.am (bin_PROGRAMS): New program: piesctl
	 (pies_SOURCES): Remove addrfmt.c and url.c.
	(noinst_HEADERS, BUILT_SOURCES): Add piesctl-cl.h
	* src/cmdline.opt: Use pp_* function family to build
	preprocessor command line.
	* src/ctl.c (http_header_hash): Use case-insensitive hashing.
	(ctlio_finalize_reply): Don't close connection after sending 401
	response.
	(input): Remove ws and wsflags.  All uses changed.
	(input_append): Use strsplit3 to parse the request line.
	* src/pies.c: Use pp_* function family to build
	preprocessor command line.
	Move assert_, mkfilename and _cb+_url functions into libpies.
	* src/pies.h (pies_sockaddr_storage): Move to libpies.h

	* src/piesctl.c: New file.
	* src/piesctl-cl.opt: New file.

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

	ctl: use numeric type for PIDS and wakeup time values.

2015-12-25  Sergey Poznyakoff  <gray@gnu.org>

	REST control protocol.

	* configure.ac (GRECS_SETUP): Add json
	* gnulib.modules: Add base64.
	* grecs: Upgrade.
	* src/ctl.c: Rewrite as REST.

2015-12-20  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes in init mode

	* src/ctl.c (ctl_open): Add missing return.
	* src/pies.c (config_parse): Return if tree is null.
	(main) [INIT_EMU]: Print more info. Override default init_fifo.
	Don't use syslog and control socket if running as init process.
	* src/pies.h (init_fifo): New extern.
	* src/progman.c (open_redirector): Return -1 if running as init process.
	(prog_start): Always initialize redir[].
	* src/sysvinit.c (init_fifo): New variable.  Use it instead if the
	INIT_FIFO macro.
	(inittrans): Call create_fifo once, when transiting from boot to
	normal state.

2015-12-19  Sergey Poznyakoff  <gray@gnu.org>

	Update grecs

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

	Fixes

	* src/ctl.c: Make "id" command accessible only to
	administrators
	(cmd_id): Print PID.
	(ctlio_do_command): Reword 510 text.
	* src/pies.c (config_file): Remove "next"
	(conf_head, conf_tail): Remove.  Use grecs_list instead.
	All uses changed.

	Improve is_group_member functions.

	* ident/pam.c: Use is_array_member as intended.
	* ident/system.c: Likewise.

	Implement user privileges

	* src/pies.h (component): New members: list_acl and
	adm_acl.
	(control): Removed id_acl.
	New members: adm_acl and usr_acl.
	* src/pies.c (component_keywords): New keywords list-acl and
	admin-acl. Removed identity-acl.
	* ident/ident.c (pies_identity_user_name): New function.
	* ident/identity.h (pies_identity_user_name): New proto.
	* src/ctl.c (CTL_USER_STATE,CTL_ADMIN_STATE): New states.
	(cmdtab): Mark administrative commands as valid in CTL_ADMIN_STATE
	(ctlio_create): Assume CTL_ADMIN_STATE in the absense of identity
	providers.
	(auth_data): New struct.
	(cmd_auth): Select appropriate state depending on the user permissions.
	(list_matches): New function.
	(eval_env): Keep the list of selected progs.
	(count_prog): Removed.
	(selector): New function.
	(cmd_list): Rewrite to take into account access rights.
	(cmd_start,cmd_stop)
	(cmd_restart): Only allowed for users with administrative
	privileges.

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

	Minor fixes.

	* grecs: Upgrade.
	* lib/parsetime.c: Fix senseless compiler warnings.
	* src/acl.c: Fix docstrings.
	* src/meta1gram.y (yyerror): Change argument
	* src/meta1lex.l: Add flex options
	* src/pies.h (meta1error): Change signature.
	* src/progman.c (prog_lookup_by_socket): Remove.
	* src/sysvinit.c (sysvinit_stop_filter): Remove.

	Update grecs

2015-12-16  Sergey Poznyakoff  <gray@gnu.org>

	Update gnulib

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

	Implement authentication on control socket.

	* Makefile.am (SUBDIRS): Add src.
	* configure.ac: Check for crypt.h and PAM
	Build ident/Makefile
	* grecs: Update.

	* ident/Makefile.am: New file.
	* ident/ident.c: New file.
	* ident/ident.h: New file.
	* ident/identity.h: New file.
	* ident/pam.c: New file.
	* ident/provider.c: New file.
	* ident/system.c: New file.

	* lib/Makefile.am: Add arraymember.c
	* lib/arraymember.c: New file.
	* lib/libpies.h (is_array_member): New proto.

	* src/Makefile.am (LDADD): Add libident.a and @PAM_LIBS@
	* src/acl.c (acl_entry): Remove groups. Add new members:
	names and name_match.
	(pies_acl_create): Deep copy the locus.
	Set free_entry function for the list.
	(pies_acl_free): Free locus.
	(_parse_from): Set free_entry function for the list.
	(_parse_group): Parse the "user" construct.
	(parse_acl_line): Deep copy the locus.
	Allow for null value.
	(acl_keywords): Update docstrings.
	(_acl_check): Rewrite identity checks.
	* src/acl.h (acl_input)<user,groups>: Remove.
	<identity>: New member.
	(pies_acl_free): New proto.
	* src/ctl.c (identity): New global.
	(cmdtab): New command: auth
	(ctlio) <addr,addrlen>: New members.
	(ctlio_create): Start from authenticated state
	only if no identity_providers are configured.
	(cmd_auth): New function.
	(cmd_help): Print only commands that are available
	in the current state.
	(ctl_accept): Initialize io->addr and io->addrlen.
	* src/inetd-bi.c: Change call to check_acl
	* src/pies.c: Include identity.h
	(control_keywords): New statement "identity-acl"
	(pies_keywords): New statement "identity-provider"
	(config_init): Register identity mechanisms.
	(config_parse): New function.
	(config_help): Print help on identity-provider
	statements.
	(main): Use config_parse to parse grecs-style configurations.
	* src/pies.h: Include identity.h
	(check_acl): Change argument list.  All callers changed.
	(control): Remove acl. Add conn_acl and id_acl instead.
	* src/progman.c (check_acl): Change argument list.  Take
	identity as the 3rd argument.

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

	Fix descriptor leak

	* src/progman.c (prog_start): Close redirection fd's
	* grecs: Upgrade.

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

	Bugfixes

	* src/ctl.c (cmd_reboot, ctl_shutdown): Use code 221 to indicate that
	we are going to close clonnection
	(ctlwr): Check return from write.
	* src/pies.c: Handle SIGPIPE

2015-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	New ctl commands: start, stop, restart, reboot, shutdown.

	* src/ctl.c (CTL_ACTION_STATE): New state.
	(cmdtab): Add new commands: start, stop, restart, reboot,
	shutdown.
	(ctlio)<action>: New member.
	(ctlio_create): Initialize action.
	(list_prog): List scheduled wakeup time for sleeping components.
	(cmd_start,cmd_stop)
	(cmd_restart,cmd_reboot,cmd_shutdown): New functions.
	(ctlwr): Handle CTL_ACTION_STATE.
	* src/pies.c (pies_schedule_action): New function.
	(stop_components): Use progman_stop_tag().
	* src/pies.h (pies_schedule_action, progman_stop_tag): New protos.
	(progman_stop_component): Remove.
	* src/prog.h (progman_locate, progman_stop_component): New protos.
	* src/progman.c (progman_locate): New function.
	(progman_cleanup): Set status depending on the CF_DISABLED bit.
	(progman_stop_component): Take struct prog* as argument.
	(progman_stop_tag): New function.

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

	control socket: list types

	* src/ctl.c: list prog types and search on them
	* src/progman.c (progman_foreach): Iterate over all elements, not
	only components.
	* src/sysvinit.c (runlevel_setup_prog): Check if prog is a component.

	Implement list control command.

	* src/ctl.c: Implement list.
	* src/prog.h (IS_COMPONENT): New macro (from progman.c)
	* src/progman.c: Move IS_COMPONENT to src/prog.h
	* src/socket.c (create_socket): Clear uid, gid and umaskval for
	inet sockets.

2015-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Introduce control connection.

	* src/ctl.c: New file.
	* src/Makefile.am (pies_SOURCES): Add ctl.c
	* src/pies.c: New configuration statement "control"
	* src/pies.h (instance, ctl_url): New externs.
	(register_socket): Change signature.
	(update_socket,ctl_open): New protos.
	* src/socket.c (listenset): Remove.
	(fdset): New static.
	(sockinst)<handler>: Array of three pointers: handlers for
	read, write, and exception, correspondingly.
	(find_socket_handler): Remove.
	(register_socket): Take three function pointers as arguments.
	Update corresponding elements of fdset.
	(update_socket): New function.
	(pies_pause): Handle all three I/O operations.
	(deregister_socket)
	(register_program_socket)
	(disable_socket,enable_socket): Reflect the changes.
	* src/sysvinit.c (create_fifo): Update call to register_socket.

2015-08-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix doc generation.

	The default Config file applies to all output formats, which is wrong.
	Use a dedicated configuration file for html output formats, and
	defaults for the rest.

	* doc/Config: Rename to doc/html.init (with changes).

2015-03-01  Sergey Poznyakoff  <gray@gnu.org>

	Switch to Texinfo 5.0

	* doc/Config: Rewrite.
	* doc/Makefile.am: Use Makeinfo 5 instead of texi2htm
	* doc/gendocs_template: Ps is not built
	* imprimatur: Upgrade.

2015-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	New component flag: nullinput

	* NEWS: Update.
	* doc/pies.texi: Document nullinput flag.
	* src/pies.c (str_to_cf): New flag: nullinput
	* src/pies.h (CF_NULLINPUT): New flag.
	* src/progman.c (prog_start): If CF_NULLINPUT flag is set,
	redirect /dev/null to the stdin

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

	Minor fixes.

	* lib/proctitle.c (mf_proctitle_format): Check return from
	vasprintf instead of checking the return pointer.
	* src/inetd-bi.c: Check return values from write where reasonable.
	* src/progman.c (redirect_to_file): Check return from chown.
	(close_fds): Fix coredump (upper boundary was wrong).
	(open_redirector, progman_dump_stats): Check return values.
	* src/sysvinit.c (sysvinit_setenv): Remove unused variable.
	* src/userprivs.c (str_eq, str_dispose): Remove unused functions.
	* src/utmp.c: Check return values.

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

	Implement globbing patterns in include statements.

	* grecs: Upgrade.
	* doc/pies.texi: Document built-in include and line directives.
	* src/cmdline.opt: New option -I (--include-directory).

	* configure.ac: Version 1.2.91
	* NEWS: Update.

2014-06-11  Sergey Poznyakoff  <gray@gnu.org>

	Init emulator mode; bugfix.

	* src/pies.c (main) [INIT_EMU]: Enable "init emulator" mode.
	* src/sysvinit.c (enablecomp)
	(sysvinit_runlevel_setup): Use struct enstate to pass information
	to the callback. This fixes bug introduced by the previous commit,
	which caused "wait" keyword to be ignored.

2014-06-09  Sergey Poznyakoff  <gray@gnu.org>

	Implement ctrlaltdel and kbrequest processes.

	* src/sysdep.c: New file.
	* src/Makefile.am (pies_SOURCES): Add sysdep.c
	* src/pies.c (ACTION_*): Move to pies.h
	(sig_handler): Call sysvinit_sigtrans, return immediately
	if it handles the signal.
	(setsigvhan): New function.
	(add_extra_sigv): New function.
	(signal_setup): Rewrite.
	(main): Handle ACTION_CTRLALTDEL and ACTION_KBREQUEST.
	* src/pies.h (PIES_COMP_DEFAULT)
	(PIES_COMP_WAIT,PIES_COMP_MASK): New defines.
	(pies_action): New enum, add new actions: ACTION_CTRLALTDEL
	and ACTION_KBREQUEST.
	(setsigvhan, add_extra_sigv)
	(sysvinit_sigtrans,sysvinit_runlevel_setup)
	(sysvinit_sysdep_begin): New protos.
	(sysvinit_request) <pad>: Rename to data.
	* src/sysvinit.c (enablecomp): Change meaning of the data pointer.
	(sysvinit_runlevel_setup): Change signature. Remove static qualifier.
	All uses changed.
	(sysvinit_setenv): New static.
	(sysvinit_fifo_handler): Handle INIT_CMD_SETENV.
	(sysvinit_sigtrans): New function.
	(sysvinit_begin): Set up new signals.
	Call sysvinit_sysdep_begin.

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

	Upgrade grecs

2013-01-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add function for parsing /etc/inittab.

	* src/limits.c (free_limits): New function.
	* src/pies.c (config_syntax): Move to pies.h
	(config_syntax_tab): New type "inittab"
	(free_action,component_free): New functions.
	(component_finish): Call component_free to discard the
	failed component.
	(main): In sysvinit mode, default to reading two configuration files:
	/etc/inittab and /etc/pies.init.
	Don't exit on configuration errors in this mode.
	* src/pies.h (str_to_config_syntax)
	(add_config,free_redirector)
	(component_free,free_limits)
	(inittab_parse): New protos.
	* src/progman.c (free_redirector): New function.
	* src/sysvinit.c (inittab_parse): New function.

	Fix sysvinit execution environment, simplify boot state system.

	* src/pies.c (_cb_runlevels): Bugfix.
	(set_console_dev): Move to sysvinit.c
	* src/pies.h (progman_sysvinit_enable): Remove proto.
	(console_open, telinit): New protos.
	(sysvinit_environ_hint): New extern.
	* src/prog.h (prog_stop): New proto.
	* src/progman.c (env_concat): Bugfix.
	(env_concat): In sysvinit mode, apply sysvinit_environ_hint
	to the environment.
	(console_open, console_stty): Move to sysvinit.c

	* src/sysvinit.c (boot_state): Simplify state set.
	(getinitdefault, askrunlevel): New functions.
	(sysvinit_runlevel_setup): New function.
	(enablecomp): Change signature to match progman_foreach API.
	(sysvinit_begin): Prepare console, become a session leader,
	prepare environment.
	(inittrans): Call sysvinit_runlevel_setup

	* src/socket.c (calc_fd_max): Fix return type.
	* src/acl.c (acl_copy): Remove unused variable.

2013-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

	Fix runlevel transition algorithm, implement SysV-style fifo interface.

	* src/prog.h: New file.
	* src/Makefile.am: Add new file.
	* src/cmdline.opt: New option --telinit (-T).
	* src/diag.c (vlogmsg): In sysvin it mode, write
	directly to the console. Close it when finished.
	* src/pies.c (_cb_initdefault, _cb_runlevels): Use is_valid_runlevel
	to check if the specified runlevels are ok.
	(main): In sysvinit mode, reset action to ACTION_CONT.
	* src/pies.h (progman_filter): New proto.
	(progman_accept,register_socket): Change signature.
	(deregister_socket): New proto.
	(register_program_socket): New proto.
	* src/progman.c: Move constant and adatatype definitions to
	prog.h
	(prog_stop): Remove static qualifier.
	(console_open): Likewise.
	(progman_accept): Use new socket API.
	(progman_stop): Correctly handle timeouts.
	(progman_foreach): New function.
	* src/socket.c: Register all sockets along with their handlers
	in a doubly-linked list.
	(sockinst): New struct.
	(register_socket,deregister_socket): New functions.
	(register_program_socket): New function.
	(pies_pause): Traverse the list to find which fd has changed.
	Use its registered handler to handle the event.
	* src/sysvinit.c: Include prog.h
	(is_valid_runlevel): New function.
	(sysvinit_fifo_handler,check_fifo): New static functions.
	(inittrans): Fix transition algorithm.
	(telinit): New function.

2013-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Write utmp/wtmp records in sysvinit mode.

	* configure.ac: Check for utmp.h, utmpx.h
	* src/utmp.c: New file.
	* src/Makefile.am: Add utmp.c
	* src/pies.h (sysvinit_acct): New proto.
	* src/progman.c (prog_start, progman_cleanup): Call sysvinit_acct.
	* src/sysvinit.c (inittrans): Call sysvinit_acct.
	Set proctitle.

2013-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix sysvinit transition logic.

	* src/pies.c (main): Call sysvinit_begin to initialize
	sysvinit subsystem.
	In the main loop, force wakeup if inittrans returns 1.
	* src/pies.h (is_sysvinit): Rewrite macro.
	(progman_sysvinit_enable): New proto.
	(inittrans): Change return type.
	* src/progman.c (progman_sysvinit_enable): New function.
	(progman_running_p): Additional debugging.
	(prog_start): Special handling for sysvinit components.
	Remove calls to runlevel_match
	* src/sysvinit.c (runlevel_match): Remove function.
	(sysvinit_begin): New function.
	(inittrans): Return boolean value indicating whether a
	transition has been made. Call progman_sysvinit_enable to
	change the status of sysvinit components as appropriate.

	Minor fixes.

	* src/pies.c (modetab): Discern between "wait" and "respawn".
	* src/progman.c (progman_cleanup): Mark a terminated sysvinit
	component as status_finished.

	Fix grecs usage

	Implement runlevel transitions.

	* src/sysvinit.c: New file.
	* src/Makefile.am: Add new file.
	* src/pies.c (initdefault, dfl_level): Move to sysvinit.c
	(modetab): Add new modes.
	(inittrans): Move to sysvinit.c
	* src/pies.h (is_sysvinit): New macro.
	(dfl_level): New extern.
	(runlevel_match, inittrans, is_comp_wait): New protos.
	* src/progman.c (progman_running_p): Take into account only
	components. Use is_comp_wait to determine if the component
	should be waited for.
	(prog_start): Run sysvinit components only when started as
	init process.
	(runlevel_match): Move to sysvinit.c
	(prog_start_prerequisites): Return immediately if
	the component is disabled.

	Initial support for running as init process.

	* grecs: Upgrade.
	* lib/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
	* src/Makefile.am: Likewise.
	* src/acl.c: Update grecs_keyword definitions.
	* src/inetd.c (inetd_conf_file): Bugfix. The ws structure could
	be free'd prior to initialization.
	* src/pies.c: Update grecs_keyword definitions.
	(init_process,initdefault,dfl_level): New globals.
	(modetab) <once>: New keyword.
	(component_keywords)<runlevels,initdefault>: New keywords.
	(main): Initial support for init(8) mode.
	* src/pies.h (pies_comp_mode) <pies_comp_exec_once>: New constant.
	(component)<runlevels>: New member.
	(init_process,console_device,initdefault): New externs.
	* src/progman.c (prog_status)<status_finished>: New status.
	(prog)<runlevels>: New member.
	(progman_running_p): New function.
	(prog_start): Special handling for init process mode.
	(progman_start): Likewise. Take into account runlevels.
	(progman_dump_stats): New flag 'f' for status_finished.

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

	Bugfix.

	* src/meta1lex.l: Fix mistyped preproc directive.

2012-07-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* src/progman.c (prog_stop): Access v.p.comp->flags only
	if the argument points to a component.

2012-07-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Upgrade imprimatur.

2012-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix saturation of the connection table.

	* src/progman.c (conn_class_copy): Zero out the source after
	copying (fix typo).
	(conn_class_lookup): Bail out if grecs_symtab_lookup_or_install
	fails.
	(conn_class_report): Take two arguments, the first one being
	the priority to use for logging.
	All uses changed.
	(conn_class_remove): New function.
	(progman_cleanup): Call conn_class_remove when the number
	of connections for that class reaches zero.

2011-10-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Document siggroup flag.

2011-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* doc/Makefile.am (check-options): Change to match the recent changes.

	Switch to the latest Grecs.

	* Makefile.am (ChangeLog): Use git2chg.awk to build it.
	* NEWS: Update.
	* bootstrap.conf (gnulib_modules): Grecs does not depend on gnulib any more.
	* configure.ac: Version 1.2.90.
	Define GRECS_HOST_PROJECT_INCLUDES, remove grecs Makefiles from
	AC_CONFIG_FILES: it is now done by GRECS_SETUP itself.
	* gnulib.modules (gitlog-to-changelog,argp): Remove.
	(configmake): New module.
	* grecs: Update to a52ab6c6.
	* lib/libpies.h: Remove redefinitions of _() and N_().
	* src/Makefile.am: Update for the recent grecs.
	* src/acl.c: Rewrite using Grecs support for lists and symtabs.
	* src/acl.h: Likewise.
	* src/diag.c: Likewise.
	* src/inetd.c: Likewise.
	* src/meta1gram.y: Likewise.
	* src/meta1lex.h: Likewise.
	* src/meta1lex.l: Likewise.
	* src/pies.c: Likewise.
	* src/pies.h: Likewise.
	* src/progman.c: Likewise.
	* src/userprivs.c: Likewise.

2011-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use Imprimatur for docs processing.

	* .gitmodules: Add imprimatur.
	* Makefile.am (ACLOCAL_AMFLAGS,SUBDIRS): Add imprimatur.
	* configure.ac: Require gettext 0.18. Call IMPRIMATUR_INIT.
	Define ATTRIBUTE_NORETURN, if not defined already.
	* doc/Makefile.am: Use imprimatur. Drop files that are
	no longer necessary.
	* doc/check-docs.sh: Delete.
	* doc/fix-sentence-spacing.sed: Delete.
	* doc/mastermenu.el: Delete.
	* doc/rendition.texi: Delete.
	* doc/untabify.el: Delete.

	* doc/pies.texi: Use @: where appropriate.

	* src/pies.c (main): Use _() instead of N_().

2010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove pidfile when exiting or restarting.

	* src/pies.c (main): Remove pidfile after exiting the
	event loop.

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

	Update copyright years.

	Happy GNU Year!

	New keyword "siggroup" + bugfix.

	* src/pies.c (str_to_cf): New keyword "siggroup".
	* src/pies.h (CF_SIGGROUP): New constant.
	* src/progman.c (prog_start): Call setsid in child.
	(check_stopping): If CF_SIGGROUP, send signal to
	the process group.
	(prog_stop): If CF_SIGGROUP, send signal to
	the process group.
	(send_msg,run_command): Call setsid in child.
	(progman_cleanup): Bugfix: check if prog->v.p.cclass
	is not NULL (it can be, for UDP services).

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

	Limit number of connections per socket (IP).

	* src/inetd-bi.c (fd_write): Remove. Use fd_report instead.
	* src/pies.c (component_keywords): New keywords: max-instances-message,
	max-ip-connections, max-ip-connections-message, access-denied-message.
	* src/pies.h (struct component): New members: max_ip_connections,
	access_denied_message, max_instances_message, max_ip_connections_message.
	(fd_report): New extern.
	* src/progman.c (conn_class): New struct.
	(struct prog.p): New member cclass.
	(conn_tab): New static.
	(conn_class_lookup, conn_class_report): New functions.
	(progman_run_comp): Set cclass.
	(fd_report): New function.
	(_prog_accept): In case of failure (access denied, etc.)
	optionally send response strings over the fd.
	Limit number of connections per socket (IP).
	(progman_cleanup): Update cclass counter.

	Update grecs to edcc575b.

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

	Bugfixes.

	* src/diag.c (vlogmsg): Copy va_list before printing
	it to stderr.
	* src/progman.c (print_status): First arg is const.

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

	Handle multiple MeTA1 servers.

	* src/meta1gram.y: Handle multiple MeTA1 servers with
	different tags.

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-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve the upgrade conversion script. Update docs.

	* NEWS: Update.
	* doc/Makefile.am (check-config, check-sub-config): New goals.
	(all-check-docs): Depend on the above.
	* doc/mailfromd.texi: Document syslog-async configuration
	statement.
	* doc/pragma-option.texi: Move the ignore block to doc/mailfromd.texi.
	* doc/upgrade.texi (5x0-600): Describe the changes and the
	proposed conversion procedure.
	* mfd/main.c (rename_legacy_file): new variable.
	(close_change_conf): Improve the created script.
	(cb_db_expire_interval): Bugfix.
	(database_section_param): File statement is mu_cfg_callback.
	(main): Set rename_legacy_file if necessary.

	Define the `database' configuration statement. Document new configuration.

	* doc/pragma-option.texi: New file.
	* doc/pragma-database.texi: New file.
	* doc/Makefile.am (mailfromd_TEXINFOS): Add new files.
	* doc/mailfromd.texi: Document configuration file.
	* doc/upgrade.texi (5x0-600): New section.
	* mfd/gram.y (pragma_database): Add calls to write_db_config.
	* mfd/main.c (write_db_config): New function.
	(close_change_conf): Handle 'G' records.
	(cb_relay_file): Remove duplicate function.
	(cb_db_expire_interval, cb_db_positive_expire_interval)
	(cb_db_negative_expire_interval): New functions.
	(database_section_param): New configuration file statement:
	"database".
	(database_cfg_init): New function.
	(main): Call database_cfg_init.
	* mfd/mailfromd.h (write_db_config): New prototype.

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:

	* gacopyz/gacopyz.c
	* gacopyz/proc.c
	* gacopyz/server.c
	* gacopyz/smfi.c
	* mfd/bi_db.m4
	* mfd/bi_dns.m4
	* mfd/bi_io.m4
	* mfd/bi_ipaddr.m4
	* mfd/bi_mail.m4
	* mfd/bi_other.m4
	* mfd/bi_poll.m4
	* mfd/bi_sa.m4
	* mfd/bi_string.m4
	* mfd/cache.c
	* mfd/db.c
	* mfd/dnscache.c
	* mfd/drivers.c
	* mfd/engine.c
	* mfd/gram.y
	* mfd/lex.l
	* mfd/main.c
	* mfd/mu_dbm.c
	* mfd/optab.opc
	* mfd/prog.c
	* mfd/rate.c
	* mfd/symtab.c
	* mtasim/mtasim.c
	* mtasim/openat-die.c
	* pies/pies.c
	* pies/progman.c
	* pmult/pmult.c
	* smap/smap.c
	* tests/ashadow.at
	* tests/bctx00.at
	* tests/fctx00.at
	* tests/hdr-gete.at
	* tests/invcidr.at
	* tests/invcidr2.at
	* tests/shadow.at

	Minor fixes.

	* mfd/main.c (parse_opt): Add missing break.
	(cb_include_path): Fix use of improper variable
	in MU_CFG_LIST branch.
	* am/aggr.m4 (IU_CHECK_MEMBER): Remove improper use of dnl.
	* doc/Makefile.am (check-builtins, check-mflib): Do not
	split sed expressions over multiple lines: Makefile format
	cannot handle it properly.
	* doc/mailfromd.texi: Update.
	* bootstrap: Do not apply `silentize' to gnu/gnulib.mk. Latest
	gnulib takes care of it itself.

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

	Implement getpw.* interfaces

	* mfd/bi_getpw.m4: New file.
	* mfd/Makefile.am (M4_FILES): Add bi_getpw.m4
	* doc/Makefile.am (check-builtins): Take into
	account @deftypefnx
	* NEWS, doc/mailfromd.texi: Update

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.
	* pmult/pmult.c (internal_macro_p): New function.
	(collect_stage_symbols): Do not report internal
	macros as untranslatable.
	* mfd/gram.y (register_macro): Copy macro name to
	allocated storage.

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

	Fix and improve termination actions in pies.

	* 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.
	* NEWS: Updated.

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

	MeTA1-related improvements.

	* configure.ac: Check for pmilter_S.pmfi_thrmax_[sh]. Requires
	28/0009-pmilter-configurable-maxthr.diff.
	* pmult/pmult.c: New configuration statements: max-threads-soft
	and max-threads-hard.
	* 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

	* bootstrap (silent_rules_prog): Preserve leading
	whitespace verbatim, when inserting the AM_V variables.
	Suggested by Ralf Wildenhues.
	Optionally insert the definitions of
	AM_DEFAULT_VERBOSITY, AM_V_GEN and AM_V_at: useful for
	po/Makefile.in.in
	(silentize): New function.
	(slurp): Call silentize
	Call silentize on po/Makefile.in.in.
	* doc/Makefile.am, etc/Makefile.am,
	pies/Makefile.am, pmult/Makefile.am,
	tests/Makefile.am, tests/etc/Makefile.am: Add silent rule markers.

	Switch to `silent rules' mode

	* bootstrap (slurp): Convert gnulib Makefile.am to
	support silent rules.
	* configure.ac (AM_INIT_AUTOMAKE): Add silent-rules.
	Enable silent rules by default.
	* gacopyz/Makefile.am, mfd/Makefile.am: Add silent rules markers.

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

	Minor change

	* mfd/bi_db.m4: Fix comment.
	* 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.

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

	Fix the docs

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

	Minor changes.

	* NEWS: Update.
	* doc/mailfromd.texi: Reorder material.
	* doc/upgrade.texi: New file.
	* doc/fdl.texi, doc/gacopyz.texi, doc/strftime.texi: Move
	sectioning commands to the main source.
	* etc/mailfromd.rc: Reflect recent changes.
	* mfd/lex.l: Change semantics of __statedir__
	and __preproc__. Introduce __defstatedir__ and
	__defpreproc__.

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

	Finish migration to Git.

	* Makefile.am (dist-hook): Create ChangeLog.
	(ChangeLog): New rule.
	* NEWS, README-alpha, README-hacking: Update
	* gnulib.modules: Add gitlog-to-changelog
	* ChangeLog: Rename to ChangeLog.svn

	* tests/hasmx.at, tests/hostname.at, tests/ismx.at,
	tests/poll.at, tests/poll01.at, tests/poll02.at,
	tests/poll03.at, tests/rescname.at, tests/resolve.at,
	tests/testsuite.at: Skip tests if the network is down.

	Add .gitignores

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

	Version 5.0

	* configure.ac, NEWS: Version 5.0.
	* doc/mailfromd.texi, doc/pies.texi, doc/pmult.texi: Update.
	* doc/Makefile.am (check-builtins): Account for
	MF_DEFUN_VARARGS_NO_PROM.

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

	Update

	Update

	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.
	* pmult/pmult.c: Fix error message
	* doc/pies.texi: Document the configuration.

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

	Bugfixes/improvements.

	* doc/mailfromd.texi: Document replbody. Use @WRITEME where appropriate.
	* doc/rendition.texi (WRITEME): New macro.
	(UNREVISED): Reword.
	* doc/pies.texi, doc/smap.texi: Use @WRITEME
	* doc/Makefile.am (check-writeme): New rule.
	(all-check-docs): Depend on check-writeme.
	* mfd/bi_body.m4 (replbody): Can be used in any handler.
	* NEWS: Rearrange material.

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

	Pies: ensure all prereqs are started in right order before starting a dependency.

	* 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.

	Improve pies.

	* 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.

	Improve pies.

	* 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>

	Add pies.texi and smap.texi

	Document and improve pmult.

	* pmult/pmult.c (debug_level): Remove.
	(struct pmult_priv_data): Remove debug. Use pmult_debug instead.
	(macro_trans): Define Sendmail compatibility macros cn_issuer and
	cn_subject.
	(builtin_macros): Fix typo in "multiplexer".
	(define_macros): Rewrite.  The "define-macros" statement takes
	exactly two arguments, each of which can be either a string or a
	list of strings.
	* doc/values.texi, doc/mailfromd.texi, doc/pmult.texi: Update.

	* doc/Makefile.am (check-fixmes): Scan all texinfo documents.

	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.

	Implement ctype functions.

	* mfd/bi_ctype.m4: New function.
	* mfd/Makefile.am (inc_DATA): Add bi_ctype.m4.
	* doc/Makefile.am (check-builtins): Update source sed expression.
	* doc/mailfromd.texi, NEWS: Document ctype functions.

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

	Improve handling of program privileges.

	* lib/libmf.h (struct mf_privs): New data type.
	(get_user_groups, mf_priv_setup, mf_epriv_setup): New prototypes.
	* lib/userprivs.c (get_user_groups, mf_priv_setup)
	(mf_epriv_setup): New functions.

	* smap/smap.c: If user is specified, switch to effective uid/gid,
	in order for msrv to create files with right privileges, on one
	hand, and to be able to create pidfile in root-owned directories
	(e.g. /var/run), on the other hand. This requires todays snapshot
	of Mailutils.

	* 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-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* pies/Makefile.am (LDADD): Add MF_PROCTITLE_LIBS

	Bugfix.

	* lib/proctitle.c (mf_proctitle_format):
	* pies/progman.c (progman_register_retranslators): Register
	retranslators only for retr_syslog.
	(open_retranslator): Do not prepend program name to the proctitle.
	It is done automatically by the library.
	* lib/proctitle.c: Declare environ.
	Define __progname if not defined in libc.
	(mf_proctitle_init): Set __progname.
	(mf_proctitle_format): Prepend program name to the proctitle.

	Implement file output redirection.

	* pies/pies.h (enum retr_type): New constants.
	(struct retranslator): New type.
	(struct component): Change type of retr to struct retranslator.
	All uses updated.
	* pies/pies.c (_cb_retr): Takes two arguments:
	redirection type and file name or syslog priority.
	(make_full_name): New function.
	(component_verify): Check retr file names.
	* pies/progman.c (redirect_to_file): New function.
	(open_retranslator): Handle file redirects.
	(prog_start): Open /dev/null in wronly mode.
	* pies/meta1gram.y (create_retr_node): New function.
	(translate_node_list): Create default "stderr" statement.

	Implement setproctitle functionality for pies.

	* am: New directory.
	* am/aggr.m4, am/debug.m4: New files (from acinclude.m4)
	* am/proctitle.m4: New file.
	* acinclude.m4: Removed.
	* configure.ac: Call MF_PROCTITLE.
	* lib/libmf.h (mf_proctitle_format): New prototype.
	* lib/proctitle.c: New file.
	* lib/Makefile.am (libmf_a_SOURCES): Add proctitle.c.
	* Makefile.am (ACLOCAL_AMFLAGS): Add -I am

	* pies/pies.c (main): Call mf_proctitle_init.
	* pies/progman.c (retr_tag): Rewrite in a safer way.
	(open_retranslator): Set program title in child.

	Allow to complement existing components (useful for MeTA1 includes).

	* pies/pies.c (component_verify): New function.
	(component_section_parser): Call component_verify.
	(_cm_include_meta1): Reduce the tree at once.
	(parse_meta1_conf): Not needed any more.
	* pies/progman.c (progman_register_retranslators): New function.
	(pies/progman.c): Do not register retranslators: wait until the
	entire config is parsed and do that in progman_start.
	(progman_start): Call progman_register_retranslators.

	Optonal semicolon after a simple statement

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

	Implement dependencies/prerequisites in MeTA1.

	* pies/pies.c (component_cfg_param): Rename "depend" to
	"prerequisites". Add new keyword "dependents".
	(pies_cfg_param): New keyword "limits".
	* pies/progman.c (struct prog): Rename "depend" to "prereq".
	(prog_start_dependencies): Rename to prog_start_prerequisites
	(register_prog0): Do not fill prereq. This will be done later,
	when all dependencies are resolved.
	(prog_rebuild_prerequisites): New function.
	(prog_start): Per-component limitis override system-wide ones.
	(component_fixup_depend, fixup_prerequisites)
	(rebuild_prerequisites): New functions.
	(progman_build_depmap): Call fixup_prerequisites and
	rebuild_prerequisites.
	(prog_stop_dependent): Rename to prog_stop_dependents.
	* pies/meta1gram.y: Implement restart_dependencies.
	* pies/pies.h (struct component): Rename "depend" to "prereq". Add
	new member "depend".
	(pies_limits): New extern.

	* pies/pies.rcin: Update

	Implement MeTA1 configuration file parser.

	* configure.ac: Require Mailutils 1.9.93
	* doc/mailfromd.texi, NEWS: Update.
	* pies/pies.c (_cb_depend): Accept list argument.
	(component_cfg_param): New statement: program.
	(pies_cfg_param): New statements: include-meta1 and
	meta1-queue-dir.
	(parse_meta1_conf, pies_cfg_verifier): New functions.
	(main): Set mu_app_cfg_verifier. Call parse_meta1_conf.
	* pies/progman.c (progman_lookup_component): New function.
	(prog_start): Pass program name (eventually differing from
	argv[0]).
	* pies/pies.h (struct component): New member `program'.
	(progman_lookup_component): New prototype.
	* pies/meta1gram.y, pies/meta1lex.h, pies/meta1lex.l: New files.
	* pies/Makefile.am (pies_SOURCES): Add meta1gram.y and
	pies/meta1lex.h.
	(noinst_HEADERS, AM_YFLAGS, AM_LFLAGS): New variables.

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

	Bugfixes

	* pies/pies.c (component_cfg_param, pies_cfg_param): New keyword:
	allgroups.
	(pies_add_allgroups): New function.
	* pies/limits.c: Fix debug statements.
	* pies/progman.c (build_depmap): Rename to
	progman_build_depmap. Make extern, for future use. All callers
	updated.
	* pies/pies.h (progman_build_depmap): New proto.

	pies: rename open_socket to create_socket

	Bugfixes

	* pies/pies.c: Fix ACTION_COMPRELOAD
	* pies/progman.c (open_retranslator): (child) close all open
	sockets, except p[0] (pipe input).
	(prog_start): Bugfix: mark sleeping components with
	status_sleeping.
	(prog_start): stdout retranslation works for pies_comp_pass_fd.
	Mark started processes with status_enabled.
	(progman_start): Start enabled processes if pid is 0.
	(progman_stop_component): Correctly handle various status types.
	(progman_dump_stats): Mark processes being stopped.

	Bugfixes

	* pies/pies.c (component_cfg_param): Bugfix.
	(component_section_parser): Initialize comp->pass_fd_socket
	* pies/progman.c (prog_start): Listen on the socket, if in pass_fd
	mode. Avoid closing it.
	(prog_stop_all): Kill programs being stopped.
	* pies/socket.c (pass_fd): Check return from open_unix_socket.

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

	Rewrite pies to incorporate into it the functionality of inetd and mcp.

	* pies/pies.c (pmult_debug): Rename to pies_debug.
	(pies_acl): New global.
	(component_cfg_param): New statements: mode, socket,
	pass-fd-socket, acl, limits.
	(component_section_parser): Allocate comp. Check its consistency
	on mu_cfg_section_end.
	(pies_cfg_param): New statement: acl.
	(main): Call mu_acl_cfg_init. Use pies_pause instead of pause.
	* pies/limits.c: New file.
	* pies/progman.c (enum prog_status): New status: status_listener.
	(struct prog): Keep a pointer to the original struct component,
	instead of copying its fields (except for depend, which is copied
	anyway). All uses updated.
	(prog_lookup_by_socket, unlink_prog, register_prog0): New
	functions.
	(prog_start, progman_cleanup, progman_stop_component): Rewrite to
	take into account various component modes.
	(pies_check_acl): New function.
	(progman_accept): New function.
	* pies/pies.h (limits_record_t): New typedef.
	(enum pies_comp_mode): New constants.
	(struct component): New members: mode, limits, socket_url,
	pass_fd_socket, acl.
	(progman_accept): New proto.
	(pies_pause, register_listener, pass_fd, open_socket)
	(parse_limits, set_limits): New protos.
	* pies/Makefile.am (pies_SOURCES): Add limits.c and socket.c
	* pies/socket.c: New file.

	* configure.ac: Check for msg_control and msg_accrights in struct
	msghdr.
	* acinclude.m4 (IU_CHECK_MEMBER, IU_CHECK_MEMBERS): New macros
	(from inetutils).

	Minor fixes.

	* pies/progman.c (prog_start): Bugfix.
	* pmult/pmult.c (pmult_cfg_param): New configuration statement
	pmilter-debug.
	(main): Call sm_pmfi_setdbg.

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

	Improvements.

	* mflib/verp.mf (verp_extract_user): Pass email as the first
	argument.
	* doc/mailfromd.texi: Update.
	* doc/Makefile.am: Add pmult.texi
	* doc/pmult.texi: New file.
	* mfd/lex.l: %% and $$ in quoted strings are replaced by single %
	and $, correspondingly.
	* NEWS: Update.

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

	Allow to configure which macros to pass to the filter.

	* gnulib.modules: Add inttostr
	* smap/smap.c, pies/progman.c, pies/pies.h: Use umaxtostr, instead
	of mu_umaxtostr.

	* pmult/pmult.c (struct pmult_priv_data): New members: argc,
	argv.
	(macro_trans, meta_stage_trans, macrotab, macronames): New
	globals.
	(translate_macros0, translate_macros): New functions.
	(define_macros, define_macros_iter): New functions.
	(_cb_define, request_auth_macros): New functions.
	(pmult_cfg_param): New keyword `define-macro'.
	(pmult_free): Free argv.
	(pmult_negotiate): Use sm_pmfi_setmacs, if available.
	(pmult_connect, pmult_helo, pmult_mail, pmult_rcpt)
	(pmult_data, process_headers, pmult_eom): Use translate_macros.
	(main): Handle want_auth_macros.

	* configure.ac: Check for sm_pmfi_setmacs. This function should
	appear in meta1-1.0.PreAlpha28.0.

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

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

	* gnulib.modules: Add c-ctype
	* mtasim/mtasim.c, pies/pies.h, pmult/pmult.c, lib/parsetime.c,
	mfd/lex.l, mfd/gram.y, mfd/mailfromd.h, mfd/spf.c,
	mfd/bi_sprintf.m4, mfd/bi_io.m4, mfd/pp.c, mfd/main.c: Use c-ctype,
	instead of ctype. 

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

	Introduce "precious" components.

	* 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.

	Bugfix.

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

	Terminate components in reverse order.

	* 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.

	Improvements in pies.

	* 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>

	Bugfix.

	* 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>

	Remove unused vars

	Fix MU configuration file support.

	* lib/libmf.h (config_array_to_argv)
	(config_array_to_string, config_cb_timeout): new prototypes.
	* lib/utils.c: New
	* lib/Makefile.am (libmf_a_SOURCES): Add utils.c
	* mfd/gram.y (defer_initialize_variable): Both args are const.
	* mfd/mailfromd.h (defer_initialize_variable)
	(add_include_dir): Change signatures.
	* mfd/pp.c (add_include_dir): Arg is const.
	* pies/pies.c, pmult/pmult.c, mfd/main.c: Rewrite configuration
	file support to match changes in Mailutils.

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

	Version 4.9.93

	* configure.ac: Version 4.9.93
	* NEWS: Likewise.
	* pies/pies.c: Change description.

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

	* pies/pies.h: Include stdint.h * configure.ac: Fix checking for libresolv.

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

	* doc/Makefile.am (check-refs, check-fixmes): Print correct locations for multiple input files. Return a meaningful error code. * TODO: Update.

	Rewrite the bootstrap suite.

	* README-alpha: Rewritten.
	* bootstrap.conf: Rewritten.
	* bootstrap: Slightly modified version from gnulib.
	* gnulib.modules, README-hacking: New files.
	* doc/mailfromd.texi: Minor fix.

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

	Port r1632 of branches/release_4_3_patches.

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

	Use ngettext

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

	Minor fixes in translatable strings

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.

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