12020-12-14  Sergey Poznyakoff  <gray@gnu.org>
2
3	Version 1.5
4
52020-12-09  Sergey Poznyakoff  <gray@gnu.org>
6
7	Version 1.4.97
8
9	Emit explicit syslog marks when truncating very long messages.
10
11	* src/syslog.c (log_message): New field: trunc.
12	(log_message_in_create): Initialize trunc
13	(log_message_in_format): Raise trunc on buffer overflow.
14	(log_message_enqueue): Emit the "message truncated" diagnostics
15	when needed.
16
17	Fix handling of very long captured lines
18
19	* src/progman.c (redirect_read): Break the loop if no newline is found.
20
21	Rework generation of the web docs
22
232020-12-08  Sergey Poznyakoff  <gray@gnu.org>
24
25	Global env statement.
26
27	* NEWS: Update.
28	* doc/pies.texi: Document the global env statement.
29	* src/pies.c: Modify "env" callbacks to expect a envop_t **
30	as modifiable target.
31	Introduce global env statement.
32	* tests/envglobal.at: New test.
33	* tests/Makefile.am: Add new file.
34
35	Improve syslog redirection
36
37	* NEWS: Change wording a bit.
38	* src/progman.c (redirect_to_file): Close and deregister the
39	descriptor on error and EOF.
40	* src/syslog.c (pies_log_tag): Rename to log_tag.
41	(reopen_logger): Use PIES_LOG_DEV if log_dev is NULL.
42	(pies_syslog_set_dev): Free previously allocated log_tag (if any).
43
442020-12-07  Sergey Poznyakoff  <gray@gnu.org>
45
46	Bugfix
47
48	* src/syslog.c (pies_syslog_set_dev): Fix the return value.
49
50	Fix changing of the syslog dev. Fix bugs in closing unnecessary fds. Version 1.4.96
51
52	* lib/closefds.c [HAVE_FUNC_PROC_PIDINFO] (close_fds_sys): Fix
53	algorithm.
54	* src/pies.c (cb_syslog_dev): New callback.  Handle "dev" using it.
55	(main): Don't close fd 2 before restarting.
56	* src/pies_syslog.h (pies_syslog_set_dev): New proto.
57	* src/progman.c (prog_start,run_command): Don't close necessary fds.
58	* src/syslog.c (pies_log_dev): Mark as static.
59	(pies_syslog_set_dev): New function.
60
61	Version 1.4.95
62
63	* NEWS: Version 1.4.95
64	* configure.ac: Likewise.
65	* doc/ctl.texi: Fix formatting of JSON selectors. @deffn is
66	unable to handle them properly.
67	* doc/pies.texi: Minor changes.
68	* src/progman.c (open_redirector): Minor change to avoid
69	spurious varning.
70	* src/syslog.c: Assume conservative value instead of unportable
71	HOST_NAME_MAX.
72
73	Add missing file
74
75	New API endpoint /alive.  Improve documentation.
76
77	* doc/Makefile.am: Add ctl.texi
78	* doc/ctl.texi: New file.
79	* doc/pies.texi: Add anchors for ctl.texi
80	* src/ctl.c (json_error_reply_create): Set status depending on
81	the HTTP response code.
82	Use "message", instead of "error_message".
83	New endpoint: /alive
84	* src/inetd.c: Use grecs_getline instead of getline.
85	* src/sysvinit.c: Likewise.
86	* src/piesctl.c: Inspect "message", instead of "error_message".
87
882020-12-05  Sergey Poznyakoff  <gray@gnu.org>
89
90	Remove the component.facility keyword.  Update the docs.
91
92	* NEWS: Update.
93	* doc/pies.texi: Update.
94	* src/pies.h (component): Remove the facility field.
95	* src/comp.c: Likewise.
96	* configure.ac: Select interface to use to close fds (imported from
97	mailutils).
98	* lib/closefds.c: New file (imported from mailutils).
99	* lib/Makefile.am: Add closefds.c
100	* lib/libpies.h (pies_close_fds): New proto.
101	* src/pies.c: Use pies_close_fds
102	* src/progman.c: Likewise.
103
104	Accept full facility.priority in std{out,err} syslog statement.
105
106	* src/pies.c (string_to_syslog_facility): Take additional length argument.
107	(string_to_syslog_fp): New function.
108	(_cb_redir): Accept full facility.priority specification.
109	* src/piesctl.c: Remove legacy redirector support.
110
1112020-12-04  Sergey Poznyakoff  <gray@gnu.org>
112
113	Rewrite stdout/stderr redirection
114
115	Instead of spawning a subprocess for each redirection, read the
116	output directly from pipe and send it to syslog using an asynchronous
117	syslog implementation.
118
119	* src/syslog.c: New file.
120	* src/pies_syslog.h: New file.
121	* src/Makefile.am: Add syslog.c and pies_syslog.h
122	* src/comp.c (component_create): Use pies_log_facility.
123	* src/ctl.c (auth_prog)
124	(prog_serialize): Remove TYPE_REDIRECTOR case
125	* src/diag.c (syslog_printer): Use pies_vsyslog.
126	(syslog_open): Use pies_syslog_open.
127	(syslog_close): Use pies_syslog_close.
128	(diag_setup): Use pies_syslog_open.
129	* src/pies.c (log_facility, log_tag): Remove globals.  Use
130	pies_log_facility and pies_log_tag instead.
131	New configuration statement syslog.dev
132	* src/pies.h: Include pies_syslog.h
133	(register_socket,register_program_socket): Additional argument: free_data.
134	* src/prog.h (TYPE_REDIRECTOR): Remove.
135	(prog.v.p.redir): Change data type.
136	(prog.v.r): Remove.
137	* src/progman.c (prog_tag)
138	(destroy_prog)
139	(progman_cleanup): Remove TYPE_REDIRECTOR case
140	(prog_stop_redirectors): Deregister fds
141	(redir_tag,register_redir)
142	(update_redir): Remove.
143	(open_redirector): Rewrite.  Set up direct reader from the stream,
144	instead of spawning a subprocess.
145	(prog_start): Change open_redirector actual arguments.
146	* src/socket.c (sockinst): New member: free_data.
147	(register_socket): Initialize the free_data member.
148	(register_program_socket): Likewise.
149
1502020-12-02  Sergey Poznyakoff  <gray@gnu.org>
151
152	Version 1.4.94
153
154	Actually fix the reporting of argv when expandenv is set.
155
156	* src/progman.c (prog_start_prologue): Split into two functions:
157	prog_init, invoked before fork, and prog_start_prologue proper,
158	invoked after fork.  prog_init initializes the environment, argc,
159	and argv associated with prog.
160	(progman_run_comp): Call prog_init before calling prog_start_prologue
161	(the function is called from child process).
162	(prog_start): Run prog_init before forking.
163
164	Fix reporting of the argv over the control interface (improves c0f4c3b99b)
165
166	Version 1.4.92
167
168	Improve documentation
169
170	* doc/pies.texi: Improve documentation of variable expansion
171	and the use of pies in docker entry points.
172	* src/pies.h (vlogmsg): New proto.
173	* src/progman.c (prog_start_prologue): Set ws_error member to
174	ensure errors from ${X:?WORD} construct are properly reported.
175
176	Minor fixes in the docs
177
178	New component flag: expandenv
179
180	* NEWS: Update.
181	* doc/pies.texi: Document the expandenv flag.
182	* src/comp.c (component_finish): Warn if both "shell" and "expandenv"
183	are used together.
184	Expand command to argc/argv only unless the CF_EXPANDENV flag is given.
185	* src/pies.c (str_to_cf): New flag: expandenv
186	* src/pies.h (CF_EXPANDENV): New define.
187	* src/prog.h (struct prog): New member: argv.
188	* src/progman.c (destroy_prog): Free argv.
189	(prog_start_prologue): Expand the command line taking into account
190	the current environment if CF_EXPANDENV flag is given.  Otherwise,
191	copy the component argv to the prog.
192	(prog_execute): Use prog->v.p.argv
193	* tests/Makefile.am: Add expandenv.at
194	* tests/testsuite.at: Likewise.
195	* tests/expandenv.at: New file.
196
1972020-10-18  Sergey Poznyakoff  <gray@gnu.org>
198
199	Fix cyclic dependecy detection and reporting.
200
201	Use modified Floyd-Warshall algorithm for cyclic dependecy detection.
202	The computed next vertex indices are used when reporting the cycles
203	found.
204
205	This fixes dead loops that occurred in earlier versions when trying to
206	report cycles.  One of inputs that caused such behavior is used as a
207	new test in cyclic.at.
208
209	* src/depmap.c: Rewrite using modified Floyd-Warshall algorithm.
210	(depmap_cycle_detect,depmap_path_free): New functions.
211	* src/comp.c (report_cyclic_dependency): Take struct depmap_path *
212	as argument.
213	(component_build_depmap): Use depmap_cycle_detect to detect cyclic
214	dependencies.
215	(depmap_dump): Special handling for zero-sized depmap.
216	* tests/cyclic.at: Add new test.
217	* src/pies.h (depmap_dim, depmap_free)
218	(depmap_cycle_detect,depmap_path_free): New protos.
219	* NEWS: Document changes.
220
2212020-10-17  Sergey Poznyakoff  <gray@gnu.org>
222
223	Update copyright years
224
225	Automatically detect if pies is started from docker
226
227	* lib/envop.c: Include sys/types.h (for ssize_t).
228	* src/pies.c (is_docker,no_init_option,init_detect): New functions.
229	(main): Call init_detect.
230	* src/utmp.c: Additional cpp magic to determine WTMPX_FILE and UTMPX_FILE.
231	* NEWS: Document the changes.
232	* doc/pies.texi: Likewise.  Also, fix improper node name (inetd.conf).
233	* configure.ac: Version 1.4.91
234
2352020-10-12  Sergey Poznyakoff  <gray@gnu.org>
236
237	Make sure exited preprocessor gets cleaned up when running with PID 1.
238
239	* NEWS: Version 1.4.90
240	* configure.ac: Version 1.4.90
241	* src/pies.c (main): When running with PID 1, install a minimal
242	SIGCHLD handler before parsing configuration files.
243
2442020-06-14  Sergey Poznyakoff  <gray@gnu.org>
245
246	Fix datetime tests
247
248	* tests/builtin.at (IT_SPECIAL): Force TZ=0 to avoid false
249	failures due to DST.
250
251	Use grecs with wordsplit v1.1
252
2532019-07-10  Sergey Poznyakoff  <gray@gnu.org>
254
255	Switch to grecs b06fb7d3
256
2572019-07-02  Sergey Poznyakoff  <gray@gnu.org>
258
259	Fix doc/manual generation
260
261	Version 1.4
262
2632019-06-24  Sergey Poznyakoff  <gray@gnu.org>
264
265	Add missing libintl libraries in tests
266
267	Minor changes
268
269	* configure.ac: Minor changes
270	* lib/libpies.h: Add missing include.
271	* src/Makefile.am (pies_LDADD piesctl_LDADD): Add libintl libs
272	* src/progman.c: Remove useless code.
273	* tests/accept.at: Use canonical ordering of options and arguments.
274	* tests/builtin.at: Likewise.
275	* tests/inet.at: Likewise.
276	* tests/maxinst.at: Likewise.
277	* tests/passfd.at: Likewise.
278	* tests/version.at: Don't expect GNU sed
279
280	Enable/disable SystemV init code at compile time
281
282	* configure.ac: New option --enable-sysvinit. Disable the init
283	code if RUN_LVL is not available.
284	(PIES_SYSVINIT_ENABLED): New configuration define.
285	(PIES_COND_SYSVINIT): New condition
286	Print configuration settings summary.
287	* src/pies.h (is_sysvinit): Check for PIES_SYSVINIT_ENABLED.
288	(SYSVINIT_ACTIVE): New macro.
289	* grecs: Upgrade.
290	* src/Makefile.am: Conditionally link sysvinit-related code.
291	* src/cmdline.opt: Disable the --telinit option if sysvinit support
292	is not available.
293	(parse_options): Use SYSVINIT_ACTIVE in the conditional.
294	* src/comp.c (component_verify): Check if component definition is
295	allowed by the current state of the sysvinit support.
296	* src/ctl.c: Disable the /runlevel entry point if sysvinit support
297	is not compiled.
298	* src/diag.c (stderr_open): Make sure sysvinit-related code is not
299	compiled if the sysvinit support is not available.
300	* src/pies.c (config_syntax_tab): Add entry for CONF_INITTAB only if
301	sysvinit support is available.
302	(_cb_initdefault,_cb_runlevels): Remove. Use cb_initdefault and cb_runlevels
303	instead.
304	(component_keywords): Disable runlevels without sysvinit support.
305	(pies_keywords): Same for initdefault.
306	Use SYSVINIT_ACTIVE to suppress compilation of sysvinit code without
307	sysvinit support.
308	* src/progman.c: Use SYSVINIT_ACTIVE to suppress compilation of
309	sysvinit code without sysvinit support.
310	* src/sysvinit.c (cb_initdefault,cb_runlevels): New functions.
311
3122019-06-13  Sergey Poznyakoff  <gray@gnu.org>
313
314	Minor fixes
315
316	* grecs: Pull 12304127b5
317	* src/pies.c: Fix help message.
318
3192019-06-12  Sergey Poznyakoff  <gray@gnu.org>
320
321	Version 1.3.92
322
323	More tests for built-in services
324
325	* tests/builtin.at: Check tcpmux services.
326	* tests/nt.c: Add tcpmux support, improve error checking.
327	* tests/chargen.c: Improve error checking.
328
329	Check accept components and inet built-in services.
330
331	* src/comp.c (component_verify,component_finish): Fix check for
332	the presense of the "command" statement.
333	* src/pies.c (component_keywords): Reorder some entries for
334	the consistency of config-help output.
335
336	* tests/.gitignore: Add new files.
337	* tests/Makefile.am: Add new tests and noinst programs.
338	* tests/accept.at: New test.
339	* tests/builtin.at: New test.
340	* tests/chargen.c: New file.
341	* tests/readtime.c: New file.
342	* tests/recvfd.c: Rewrite for testing both accept and pass-fd components.
343	* tests/passfd.at: Pass -s option to recvfd
344	* tests/testsuite.at: Add new tests.
345	* tests/lines.c: Minor changes.
346	* tests/nt.c: Minor changes.
347	* tests/to.c: Minor changes.
348
3492019-06-11  Sergey Poznyakoff  <gray@gnu.org>
350
351	Test pass-fd components
352
353	* tests/recvfd.c: New source.
354	* tests/.gitignore: Update.
355	* tests/passfd.at: New test.
356	* tests/Makefile.am: Add new test.
357	* tests/testsuite.at: Add new test.
358
359	* tests/nt.c: Check all revents bits.
360
361	Improve the nt tool. Test inet running instance limit.
362
363	* tests/Makefile.am: Add new test.
364	* tests/aux/in.test (PIESCTL): Provide the necessary options.
365	Discontinue the use of STOPCMD environment variable.
366	New commands: enable, sleep, touch.
367	* tests/testsuite.at (PIES_CONTROL_INIT): Rename pidfile to PIES_PIDFILE
368	and ctlsock to PIES_CTLSOCK. Export both.
369	Include maxinst.at
370	* tests/control.at: Use new variables.
371	* tests/inet.at: Remove the env block.
372
373	* tests/iobuf.h (iobuf_copy): Return number of bytes copied.
374	* tests/maxinst.at: New file.
375	* tests/nt.c (netcat_stream_disconnect): New function.
376	(netcat_stream_read): Disconnect the peer stream if no
377	more input is available and the peer is not available for
378	output (i.e. its output buffer is empty).
379	(netcat_stream_write): Stop polling if output buffer is empty.
380	(netcat): Fix event mask
381
3822019-06-10  Sergey Poznyakoff  <gray@gnu.org>
383
384	Fix coredump
385
386	* src/comp.c (component_build_depmap): Defer removal of the
387	component to the end of the run
388
389	Bugfix
390
391	* tests/nt.c: Trivial fixes
392
3932019-06-09  Sergey Poznyakoff  <gray@gnu.org>
394
395	Test inetd components.
396
397	* lib/Makefile.am: Add urlconn.c
398	* lib/libpies.h (url_connect): New proto.
399	* lib/urlconn.c: New file.
400	* src/piesctl.c (shttp_connect): Use url_connect.
401	* tests/.gitignore: Update.
402	* tests/Makefile.am: New auxtool: aux/in.test
403	New test: inet.at
404	* tests/aux/in.test: New file.
405	* tests/inet.at: New file.
406	* tests/iobuf.h: New file.
407	* tests/nt.c: New file.
408	* tests/testsuite.at: Add new test.
409	* tests/to.c: explicitly terminate the child process on timeout.
410
4112019-06-07  Sergey Poznyakoff  <gray@gnu.org>
412
413	Implement additional env.eval statement
414
4152019-06-06  Sergey Poznyakoff  <gray@gnu.org>
416
417	Bugfix in grecs (pull c31f6e9769)
418
419	Change syntax of the env.clear statement.
420
421	It no longer requires an argument. The correct syntax is
422
423	  env {
424	     clear;
425	  }
426
427	Update the grecs submodule
428
429	* configure.ac (GRECS_SETUP): Request the tree-api
430	* grecs: Pull a0c096190f
431	* lib/envop.c (environ_set): Call wordsplit_free unconditionally.
432	* lib/grecsasrt.c (assert_grecs_value_type)
433	(assert_scalar_stmt): Remove.
434	(conf_callback_url): Switch to tree-api.
435	* lib/grecsasrt.h: Likewise.
436	* src/acl.c: Rewrite grecs callbacks in the tree API style.
437	Use grecs assertions.
438	* src/acl.h: Likewise.
439	* src/meta1parse.c: Likewise.
440	* src/pies.c: Likewise.
441	* src/piesctl.c: Likewise.
442	* src/comp.c (component_finish): Check whether the "command" statement
443	was used.
444
4452019-06-03  Sergey Poznyakoff  <gray@gnu.org>
446
447	Minor fixes
448
449	Finish the env re-implementation
450
451	* NEWS: Document the "env" statement and the PIES_MASTER_PID
452	environment variable.
453	Version 1.3.91
454	* configure.ac: Version 1.3.91
455	* doc/pies.texi: Document the new "env" statement syntax. Provide
456	instructions on how to convert legacy "env" statement to the new
457	form.
458	* lib/envop.c (environ_unset): Take reference value as argument.
459	If supplied, unset the variable only if its value matches the
460	reference one.
461	* lib/envop.h (environ_unset): Change proto.
462	* src/pies.c (parse_legacy_env): Minor changes.
463	(_cb_env_unset): Allow to specify value.
464	* src/progman.c (run_command): Define PIES_MASTER_PID.
465	* tests/env.at: Check the legacy env syntax.
466	* tests/envop.at: Additional checks.
467
4682019-06-02  Sergey Poznyakoff  <gray@gnu.org>
469
470	Speed up tests.
471
472	Presence of the ~/.netrc file can slow down execution because of eventual
473	DNS calls in hostcmp. Provide an option to disable netrc parsing and use
474	it in tests.
475
476	* src/piesctl-cl.opt: New option: --no-netrc.
477	* doc/pies.texi: Document --no-netrc
478	* src/piesctl.c (shttp_connect): Don't read ~/.netrc if given --no-netrc.
479	* tests/env.at: Pass --no-netrc to piesctl.
480	* tests/respawn.at: Likewise.
481	* tests/shell.at: Likewise.
482	* tests/shutdown.at: Likewise.
483	* tests/startup.at: Likewise.
484
485	Rewrite the testsuite
486
487	The aim is to run pies in foreground if possible. Limit execution time
488	using external wrapper.
489
490	* src/pies.c: (_cb_redir): Consistently return 1 on errors.
491
492	* tests/aux/sleepexit: New file.
493	* tests/aux/startcheck: New file.
494	* tests/aux/touchfile: Change arguments.
495	* tests/aux/respawn: Rewrite.
496
497	* tests/lines.c: New noinst program.
498	* tests/to.c: New noinst program.
499	* tests/.gitignore: Add new programs.
500	* tests/Makefile.am: Update.
501	* tests/env.at: Use to to avoid hanging forever.
502	Add missing popdef.
503	* tests/redirect.at: Use echo as component program.
504	* tests/respawn.at: Run pies in foreground. Use to to limit execution
505	time.
506	* tests/shell.at: Likewise.
507	* tests/shutdown.at: Likewise.
508	* tests/startup.at: Likewise.
509	* tests/ret-exec.at: Use sleepexit as component program.
510	* tests/ret-notify.at: Likewise.
511
512	New configuration statement for manipulating the environment.
513
514	The "env" statement is now a compound statement. It can contain four
515	substatements: "clear" to clear the environment, "keep" to retain
516	certain variable while clearing it, "set" to set a variable, and
517	"unset" to unset a variable or variables.
518
519	Both "keep" and "unset" can take globbing pattern as their argument,
520	in which case they affect all variable matching that pattern.
521
522	The value part in the "set" statement is subject to variable expansion,
523	e.g.
524
525	   set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man"
526
527	The support for the old one-line syntax of "env" is retained for
528	backward compatibility.
529
530	This commit also fixes redirection to a file: new data are appended
531	to the file, instead of overwriting it.
532
533	* lib/Makefile.am: Add new files.
534	* lib/envop.c: New file.
535	* lib/envop.h: New file.
536	* lib/wildmatch.c: New file.
537
538	* src/comp.c (component_free): Update.
539	* src/pies.c (argv_free): New function.
540	(parse_legacy_env): New function.
541	(_cb_env): Remove.
542	(cb_env_section_parser): New function.
543	(cb_env_keywords): New keywords for the "env" block statement:
544	clear, keep, set, unset.
545	(component_keywords): New compount statement: env.
546	Old usage retained for backward compatibility.
547	* src/pies.h: Include "envop.h"
548	(component)<env>: Remove.
549	<envop>: New field.
550	* src/prog.h (prog)<env>: New field.
551	* src/progman.c (redirect_to_file): Position to the end of file.
552	(DEBUG_ENVIRON): Remove macro.
553	(debug_environ): New function.
554	(environ_setup): Remove.
555	(prog_sockenv): Use environ_set to modify local copy of environment.
556	(prog_start_prologue): Use environ_create + envop_exec to create and
557	modify the environment.
558	(prog_execute): Set environment to prog-local copy.
559
560	* tests/.gitignore: Build envtest
561	* tests/Makefile.am: Add new tests.
562	* tests/testsuite.at: Add environment tests.
563	* tests/envop.at: New file.
564	* tests/envtest.c: New file.
565	* tests/env.at: New file.
566	* tests/redirect.at: Check first two lines of the output file.
567
5682019-05-31  Sergey Poznyakoff  <gray@gnu.org>
569
570	Minor fix
571
572	* tests/shell.at: Append to the outfile instead of overwriting it.
573
574	Provide an option to run commands via sh -c
575
576	The new flag "shell" instructs pies to run the command marked with it
577	as '/bin/sh -c $command'. Alternative shell can be supplied ising the
578	'program' statement.
579
580	This is useful if the command line uses shell-specific features (command
581	or variable expansion, redirection, pipes, etc.)
582
583	This commit also fixes a bug in the 'env' statement handling: a single
584	argument with embedded whitespaces was undergoing word splitting and
585	thus incorrectly handled as multiple arguments.
586
587	* NEWS: Document changes.
588	* doc/pies.texi: Likewise.
589	* src/comp.c (component_free): Free command.
590	(component_finish): Split command into argv/argc as directed by the
591	CF_SHELL flag.
592	* src/pies.c (_cb_command): Remove. Functionality moved to
593	component_finish().
594	(_cb_env): Bugfix. Don't split arguments.
595	* src/pies.h (CF_SHELL): New flag.
596	(component) <command>: New member.
597
598	* tests/Makefile.am: Add new tests.
599	* tests/testsuite.at: Add new tests.
600	* tests/aux/respawn: Change default timeout to 1 second.
601	* tests/respawn.at: Minor change.
602	* tests/shell.at: New test.
603
6042019-05-28  Sergey Poznyakoff  <gray@gnu.org>
605
606	Permit stdout redirection for startup and shutdown components.
607
608	* src/progman.c (register_prog0): Preserve comp->redir[RETR_OUT].type
609	for exec, startup, and shutdown components.
610
611	Document startup and shutdown components
612
6132019-05-24  Sergey Poznyakoff  <gray@gnu.org>
614
615	Implement shutdown components
616
617	* src/pies.h: Update comment.
618	* src/progman.c (register_prog0): Register shutdown components
619	in disabled state.
620	(program_shutdown): New function.
621	(progman_stop): Call program_shutdown.
622
623	* tests/shutdown.at: New test.
624	* tests/Makefile.am: Add new test.
625	* tests/testsuite.at: Likewise.
626	* tests/aux/startup: Rename to tests/aux/touchfile
627	* tests/startup.at: Reflect the change.
628
629	Don't remove finished startup components. Just mark them with status_finished.
630
631	* src/ctl.c (pies_comp_mode_str): Add pies_comp_startup
632	and pies_comp_shutdown.
633	* src/piesctl.c (mode_trans): Likewise.
634	* src/progman.c (progman_startup_phase): Test the status of
635	pies_comp_startup components.
636	(progman_waiting_p): Test status instead of pid>0 to select running
637	components.
638	(progman_cleanup): Set status of the finished startup
639	component to status_finished, instead of removing it.
640	* src/comp.c (loaded): Remove unused variable.
641	(component_config_commit): Remove special handling for pies_comp_startup.
642
643	Initial implementation of "startup" components.
644
645	These are components that are run at program startup. Starting
646	other components is delayed until all startup components terminate.
647	This is similar to SysV "bootwait" components.
648
649	Upon termination, startup components are removed from the configuration.
650	They are not renewed upon configuratuion reload.
651
652	* src/comp.c (comp_array_remove): Remove from the depmap as well.
653	(component_ref_decr): Use comp_array_remove for active components
654	and plain component_free for inactive ones.
655	(component_build_depmap): Use comp_array_remove.
656	(component_config_commit): Special handling for pies_comp_startup
657	components.
658	* src/pies.c (modetab): New component modes: "startup" and "shutdown".
659	(main): Run program_init_startup.
660	* src/pies.h (pies_comp_mode): New modes: pies_comp_startup and
661	pies_comp_shutdown.
662	(program_init_startup): New proto.
663	* src/progman.c (progman_waiting_p): Return 1 if a startup component
664	is still running.
665	(program_init_startup): New function.
666	(progman_cleanup): Handle pies_comp_startup termination.
667	* src/socket.c (switch_eids): Avoid unnecessary calls to setegid
668	and seteuid.
669
670	* tests/atlocal.in (auxdir): New variable.
671	* tests/mailer: Move to tests/aux/
672	* tests/respawn: Move to tests/aux/
673	* tests/retcode: Move to tests/aux/
674	* tests/aux/startup: New auxiliary program.
675	* tests/redirect.at: Start components from $auxdir.
676	* tests/respawn.at: Likewise.
677	* tests/ret-exec.at: Likewise.
678	* tests/ret-notify.at: Likewise.
679	* tests/startup.at: New file.
680	* tests/testsuite.at: Include startup.at
681	* tests/Makefile.am: Add new tests.
682
6832019-05-23  Sergey Poznyakoff  <gray@gnu.org>
684
685	Update NEWS
686
687	Update copyright years
688
689	Revise dependency handling. Correctly display cyclic dependencies.
690
691	* src/comp.c (component_log_dep): Remove.
692	(report_cyclic_dependency): New function.
693	(comp_array_remove): New function.
694	(component_build_depmap): Remove erroneous components both from
695	the component table and dependency map.
696	(components_dump_depmap): Avoid trailing whitespace in the output.
697	* src/depmap.c (depmap_clear_all): Remove.
698	(depmap_remove): New function.
699	* src/pies.h (CF_REMOVE): New flag.
700	(depmap_clear_all): Remove prototype.
701	(depmap_remove): New prototype.
702
703	* tests/Makefile.am: Add new test.
704	* tests/atlocal.in (trimws): New function.
705	* tests/cyclic.at: New test.
706	* tests/testsuite.at: Include new test.
707
7082019-05-20  Sergey Poznyakoff  <gray@gnu.org>
709
710	Upgrade grecs
711
712	Document the --no-init option. Raise version number to 1.3.90
713
7142019-05-17  Sergey Poznyakoff  <gray@gnu.org>
715
716	Provide an option to disable SysV init mode.
717
718	This is useful if pies is run as a entrypoint process in a
719	docker container.
720
721	Fix coredump in components_dump_depmap
722
723	Coredump was triggered by detected cyclic dependency.
724
7252019-02-10  Sergey Poznyakoff  <gray@gnu.org>
726
727	Minor fix
728
729	* src/Makefile.am (install-data-hook): Add missing DESTDIR
730	(Reported by Rafael Fontenelle).
731
732	Fix typos
733
734	Spotted by Rafael Fontenelle.
735
7362018-05-20  Sergey Poznyakoff  <gray@gnu.org>
737
738	Bugfix
739
740	* src/pies.c (setsigvhan): Fix setting signals
741
7422017-01-02  Sergey Poznyakoff  <gray@gnu.org>
743
744	Happy GNU Year
745
7462016-10-01  Sergey Poznyakoff  <gray@gnu.org>
747
748	Version 1.3
749
7502016-08-20  Sergey Poznyakoff  <gray@gnu.org>
751
752	Fix environment modification code
753
754	Port fixes from GNU rush
755
7562016-07-16  Sergey Poznyakoff  <gray@gnu.org>
757
758	Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/pies
759
760	Don't concatenate adjacent strings in configuration files.
761
762	* grecs: Upgrade.
763	* src/pies.h: Fix include paths.
764	* src/piesctl.c: Likewise.
765
766	* NEWS: Document changes.
767	* doc/pies.texi: Likewise.
768
7692016-04-07  Sergey Poznyakoff  <gray@gnu.org.ua>
770
771	Remove duplicate includes
772
7732016-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>
774
775	Bugfix
776
777	* lib/split3.c: Return correct error code.
778
7792016-03-19  Sergey Poznyakoff  <gray@gnu.org>
780
781	Add testsute
782
783	Bugfixes
784
785	* src/pies.c (main): Issue the start-up message after eventual changing
786	to background and the corresponding reconfiguration of diagnostic output
787	channel.
788	* src/piesctl.c (parse_condition_to_uri, com_id): Fix checking for arguments.
789
7902016-03-19  Sergey Poznyakoff  <gray@gnu.org.ua>
791
792	Fix some compilation issues on Solaris
793
794	* configure.ac: Check for libnsl
795	* src/pies.c (string_to_syslog_facility): LOG_AUTHPRIV and LOG_FTP
796	may be undefined.
797	* src/piesctl.c (EX_NOTFOUND): Rename to EX_PIES_NOTFOUND.
798	(com_list): Use default_cond.
799	* src/sysvinit.c (console_stty): Make sure CBAUDEX is defined.
800	* src/utmp.c (fill_utmp): Declare locals right before using them.
801
8022016-03-15  Sergey Poznyakoff  <gray@gnu.org.ua>
803
804	version 1.2.94
805
806	Update NEWS and README
807
8082016-03-12  Sergey Poznyakoff  <gray@gnu.org>
809
810	Spell-check
811
8122016-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
813
814	Improve docs
815
816	* doc/pies.texi: Document piesctl and identity providers.
817	* src/piesctl.c: Fix reference to the docs.
818
819	Fix pies -E
820
821	* src/pies.c (main): Fix syntax type comparison.
822
8232016-03-06  Sergey Poznyakoff  <gray@gnu.org>
824
825	Reimplement the telinit legacy interface.
826
827	pies -T is now fully compatible with the legacy telinit command
828
829	* src/telinit.opt: New file.
830	* src/Makefile.am: Add telinit.opt
831	* src/cmdline.opt (-T): Remove explicit variable.  Rest of
832	command line is processed specially.
833	* src/pies.h (telinit): Change prototype.
834	* src/sysvinit.c (telinit): Rewrite.
835	* src/.gitignore: Update.
836	* doc/pies.texi: Document telinit.
837
8382016-03-05  Sergey Poznyakoff  <gray@gnu.org>
839
840	ACL reference statements.
841
842	All ACL keywords can be used in simple statement as well as in block form.
843	As simple statements, they take a name of an already defined named ACL. E.g.:
844
845	  defacl forbid {
846		deny any;
847	  }
848
849	  component foo {
850	    list-acl forbid;
851	  }
852
853	This commit also fixes some eventual double-frees.
854
855	* doc/pies.texi: Update.
856	* src/acl.c (pies_acl)<refcnt>: New member.
857	(pies_acl_use): New function.
858	(pies_acl_create): Initialize refcnt.
859	(pies_acl_destroy): New function.
860	(pies_acl_free): Rewrite as a wrapper over pies_acl_destroy.
861	(_parse_sub_acl): Call pies_acl_use when installing a named ACL.
862	(_acl_common_section_parser): Handle grecs_callback_set_value.
863	* src/acl.h (pies_acl_destroy)
864	(pies_acl_use): New function.
865	* src/comp.c (component_free): Free acl.
866
867	Use pies_schedule_action instead of assigning action directly.
868
8692016-03-02  Sergey Poznyakoff  <gray@gnu.org>
870
871	Improve docs
872
873	Bugfixes
874
875	* src/comp.c (component_verify): Fix stdout redirection check.
876	* src/meta1parse.c (meta1_translate_node): Skip simple statements.
877	(meta1_translate_node): Allocate comp->dir
878	* doc/pies.texi: Use @example instead of @smallexample
879
880	Configurable pathname of the emergency shell
881
882	* configure.ac (EMERGENCY_SHELL): New arg_var.
883	* src/Makefile.am (AM_CPPFLAGS): Define EMERGENCY_SHELL.
884	* src/sysvinit.c (emergency_shell): Initialize with the
885	value of EMERGENCY_SHELL.
886
8872016-03-01  Sergey Poznyakoff  <gray@gnu.org.ua>
888
889	Improve documentation
890
891	* doc/Makefile.am (check-sub-config): Fix regexps.
892	* doc/pies.texi: Document init operation.
893
894	Bugfix
895
896	* src/sysvinit.c (sysvinit_environ_hint): Fix dimensions.
897
8982016-02-28  Sergey Poznyakoff  <gray@gnu.org>
899
900	Synchronize changes in runlevel with configuration reloads
901
902	State transition algorithm used this far could cause spurious component
903	wakeups in some cases.  Consider the following scenario: being in
904	runlevel N, the configuration is changed so that a component X is added
905	at runlevel N.  Then a change to runlevel N+1 is initiated.  What happens
906	then is that X is woken up (still being in runlevel N) and terminated
907	shortly afterwards, upon entering runlevel N+1.
908
909	To avoid this, configuration must be reloaded after runlevel changes.
910
911	* src/ctl.c (res_runlevel): Don't initiate ACTION_RELOAD after
912	setting the runlevel.
913	* src/pies.c (main): Begin main event loop with call
914	to pies_pause.
915	* src/pies.h (pies_set_hook): New proto.
916	(inittrans): Remove proto.
917	* src/socket.c  (pies_set_hook): New function.
918	(pies_pause): Call pies_pause_hook if defined.
919	* src/sysvinit.c (inittrans): Change to static.
920	If transition was initiated by user (e.g. by invoking telinit),
921	schedule ACTION_RELOAD.
922	(sysvinit_begin): Set inittrans as pies_hook
923
924	Minor change
925
9262016-02-26  Sergey Poznyakoff  <gray@gnu.org>
927
928	Minor fix
929
9302016-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>
931
932	piesctl: minor formatting change
933
934	Improve previous commit.
935
936	* comp.c (mark_prog): Instead of calling progman_gc, terminate the
937	prog if it is a deactivated listener.
938
939	Fix reconfiguration code
940
941	* src/comp.c (component_config_commit): Run progman_gc right
942	after mark stage, to ensure any eventual listener components
943	are properly closed before being reopened by progman_create_sockets
944
9452016-02-26  Sergey Poznyakoff  <gray@gnu.org>
946
947	Enable the use of redirectors in init mode
948
9492016-02-25  Sergey Poznyakoff  <gray@gnu.org>
950
951	Minor fix
952
9532016-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
954
955	Implement "telinit environ" ctl command
956
957	* src/ctl.c: New endpoint "environ"
958	* src/pies.h (sysvinit_envlocate)
959	(sysvinit_envdelete)
960	(sysvinit_envupdate): New protos.
961	* src/piesctl.c: New subcommand "telinit environ".
962	* src/sysvinit.c (sysvinit_envlocate)
963	(sysvinit_envdelete)
964	(sysvinit_envupdate): New functions.
965	(sysvinit_begin): Create allocated copies of
966	instance and pies_master_argv to avoid them being
967	rewritten by calls to mf_proctitle_format
968
9692016-02-24  Sergey Poznyakoff  <gray@gnu.org.ua>
970
971	Improve parsing and handling of stop, start, and restart ctl commands.
972
973	* src/ctl.c (pcond_active): New type.
974	(pcond_eval): Handle pcond_active.
975	(pcond_conv): New op: active.
976	(pcond_conv_find): Skip array elements with NULL term value.
977	(object_to_cond): Permit empty argument if no
978	handler function is defined.
979	(fun_stop): Work on all prog types.
980	(fun_start): Work only on components.
981	(fun_restart): Work only on running components.
982	* src/piesctl.c (cmdline_parser_state): New member: command.
983	(pcond_parse_unary): Handle "active" keyword.
984	(parse_condition): Change signature.
985	(parse_condition_to_uri): Likewise.
986	(default_cond): New function,
987	(com_stop, com_start, com_restart): If no arguments supplied,
988	assume default condition "type component".
989	(ctlcom_t): Change signature.  All uses changed.
990	(main): Pass a pointer to cmdline_parser_state to the
991	command handler.
992
993	Changes in prog structure
994
995	* src/prog.h (prog): Remove .facility.  Use facility from
996	the component.
997	(active,wait,stop): Move from union into the main struct.
998	All uses changed.
999
1000	Cleanup initialization code
1001
1002	* src/cmdline.opt (parse_options): Change signature.
1003	Handle sysvinit case.
1004	* src/pies.c (set_conf_file_names): Handle sysvinit case.
1005	(main): Move some parts of sysvinit-specific initialization
1006	to set_conf_file_names.
1007
10082016-02-24  Sergey Poznyakoff  <gray@gnu.org>
1009
1010	Remove spurious informational message on startup
1011
1012	Minor stylistic change
1013
1014	Version 1.2.93
1015
10162016-02-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1017
1018	Bugfixes
1019
1020	* lib/addrfmt.c: Include limits.h
1021	* src/ctl.c (fun_stop,fun_start): Ignore non-component
1022	progs.
1023	* src/pies.c (request_restart_components): Fix piesctl
1024	invocation.
1025	* src/pies.h (PIES_CHLD_RESCHEDULE_ALARM): New flag.
1026	(progman_wait_until): Remove.
1027	(progman_recompute_alarm): New proto.
1028	* src/progman.c (recompute_alarm): Remove. All uses
1029	raise PIES_CHLD_RESCHEDULE_ALARM instead.
1030	(progman_wake_sleeping): Handle status_stopping components
1031	independently on their activity flag.
1032	(prog_stop_all, progman_wait_until): Remove.
1033	(progman_stop): Rewrite using mark+sweep approach.
1034
1035	Improve logging
1036
1037	* po/POTFILES.in: Add missing source files.
1038	* grecs: Upgrade.
1039	* src/diag.c (pies_diag_printer): New function.
1040	(logfuncall): New function.
1041	* src/pies.h: Add new prototypes.
1042	* src/pies.c (main): Initialize grecs_print_diag_fun
1043	* src/acl.c: Uniformly use double-quotes in messages.  Use
1044	logfuncall where applicable.
1045	* src/comp.c: Likewise.
1046	* src/ctl.c: Likewise.
1047	* src/inetd-bi.c: Likewise.
1048	* src/inetd.c: Likewise.
1049	* src/limits.c: Likewise.
1050	* src/piesctl.c: Likewise.
1051	* src/progman.c: Likewise.
1052	* src/socket.c: Likewise.
1053	* src/sysvinit.c: Likewise.
1054
10552016-02-22  Sergey Poznyakoff  <gray@gnu.org.ua>
1056
1057	Get rid of progman_iterate_comp
1058
1059	* src/inetd-bi.c (tcpmux): Use component_foreach to
1060	handle help requests.
1061	* src/progman.c (progman_iterate_comp): Removed.
1062	* src/pies.h: Likewise.
1063
1064	Provide a default single-user entry in init mode
1065
1066	This complements 6aac230c. The entry is created unless
1067	a component for runlevel S already exists.
1068
1069	* src/comp.c (component_foreach): New function.
1070	* src/pies.h: Likewise.
1071	* src/sysvinit.c (inittab_parse): Provide default S
1072	entry unless one is already defined.
1073
10742016-02-21  Sergey Poznyakoff  <gray@gnu.org>
1075
1076	Fix dereferencing of freed memory.
1077
1078	Improper dereferencing occurred when trying to access master
1079	prog of a redirector.
1080
1081	* src/prog.h (prog) <r.comp>: New member.
1082	* src/progman.c (destroy_prog) <TYPE_COMPONENT>: Clear master
1083	pointers in both redirectors.
1084	<TYPE_REDIRECTOR>: Check if master is NULL.
1085	(register_redir): Initialize r.comp.
1086
1087	Fix memory leaks
1088
1089	Fix memory leaks when reconfiguring
1090
1091	* grecs: Upgrade.
1092	* src/acl.c (_acl_common_section_parser): Free old value.
1093	* src/pies.c: Mark statically initialized keywords with
1094	GRECS_CONST.
1095
1096	Bugfixes.
1097
1098	* src/pies.c (_cb_command,_cb_env): Free wordsplit struct.
1099	(main): Allocate log_tag.  Otherwise it might get overwritten
1100	by mf_proctitle_format.
1101
1102	Provide fall-back entry in init mode
1103
1104	* src/sysvinit.c (inittab_parse): Provide default entry if
1105	inittab cannot be read or if it defined no components.
1106	* src/comp.c (component_list_is_empty): New function.
1107	* src/pies.c (pies_read_config): Always return 0 in init mode.
1108	(main): Use LOG_DAEMON in init mode.
1109	* src/pies.h (component_list_is_empty): New proto.
1110
1111	Bugfix
1112
1113	* src/comp.c (component_config_commit): Correctly handle
1114	empty list of components.
1115
11162016-02-20  Sergey Poznyakoff  <gray@gnu.org>
1117
1118	Bugfix
1119
1120	* src/pies.c (main): Use pies_master_argv when restarting.
1121
11222016-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
1123
1124	Improve control interface
1125
1126	This commit implements the following operations on the new /conf endpoints:
1127
1128	  GET /conf/runtime     -     List configuration
1129	  PUT /conf/runtime     -     Reload configuration
1130	  POST /conf/runtime    -     Post new configuration
1131
1132	  GET /conf/files       -     List configuration files
1133	  DELETE /conf/files    -     Delete some or all configuration files
1134	                              from the list
1135	  POST /conf/files      -     Install new configuration file
1136
1137	Piesctl supports the following new commands:
1138
1139	  piesctl config reload
1140	  piesctl config file clear
1141	  piesctl config file add SYNTAX NAME
1142	  piesctl config file del[ete] NAME [NAME...]
1143	  piesctl config file list
1144
1145	* src/ctl.c (res_conf): New function.
1146	(restab): New endpoint /conf
1147	* src/pies.c (config_file_add): Set free_entry.
1148	(config_file_remove, config_file_remove_all)
1149	(config_file_list_serialize): New functions.
1150	(pies_config_parse): Bail out if tree processing fails.
1151	(pies_reload): Remove unused function.
1152	(main): Redo ACTION_RELOAD handling.
1153	Handle ACTION_COMMIT.
1154	* src/pies.h (ACTION_COMMIT): New action.
1155	(config_file_remove, config_file_remove_all)
1156	(config_file_list_serialize)
1157	(pies_read_config, progman_gc): New protos.
1158	* src/piesctl.c (cmdline_parser_state): New struct
1159	(next_token, peek_token): Take ptr to cmdline_parser_state as argument.
1160	(parse_error, require_token, assert_eol)
1161	(piesctl_format): New functions.
1162	(parse_condition_to_uri): Rewrite using piesctl_format.
1163	New subcommand: config.
1164	Improve help output.
1165
11662016-02-19  Sergey Poznyakoff  <gray@gnu.org>
1167
1168	Revamp program termination after reconfiguring.
1169
1170	* src/pies.h (PIES_CHLD_GC): New op.
1171	(progman_stop_tag): Remove proto.
1172	* src/pies.c (main): Handle PIES_CHLD_GC: stop all programs marked
1173	for termination.
1174	* src/comp.c (component_config_commit): Mark leftover components
1175	for termination, instead of waiting for them to terminate.
1176	* src/sysvinit.c (runlevel_setup_prog): Skip prog if its
1177	active status didn't change.
1178	Mark inactivated progs for termination.
1179	(sysvinit_runlevel_setup): Schedule PIES_CHLD_GC.
1180	(inittrans): Don't wait for programs to terminate. That will be done
1181	in the main loop.
1182	* src/prog.h (prog)<stop>: New boolean member.
1183	* src/progman.c (progman_cleanup)
1184	(progman_stop_component): Clear the stop flag.
1185	(progman_gc): New function.
1186	(progman_stop_tag): Remove.
1187
11882016-02-18  Sergey Poznyakoff  <gray@gnu.org>
1189
1190	Preserve the order of progs when adding new ones.
1191
1192	* src/progman.c (link_prog): Take a pointer to the reference prog
1193	as the second argument.  Link the first argument after that reference
1194	prog, or at the head of the list if the reference is NULL.
1195	(register_prog0): Make sure progs are linked exactly in the same order
1196	as the corresponding components.
1197	(prog_create_socket): Process only progs with status == status_listener
1198	(progman_start): Do the right thing depending on the prog type.
1199
1200	Fix activation/deactivation of network listeners.
1201
1202	* src/ctl.c (prog_active): New function.
1203	(prog_serialize): Use prog_active to report prog's activity state.
1204	For listener components, return also their service and tcpmux master
1205	names, if applicable.
1206	(fun_stop): Stop listeners as well.
1207	(fun_start): Start listeners.
1208	(ctlio_end): Don't close fd: this is done by deregister_socket
1209	* src/inetd-bi.c (tcpmux_help): Don't list inactive components.
1210	* src/prog.h (prog_activate_listener)
1211	(prog_deactivate_listener): New protos.
1212	* src/progman.c (prog_lookup_by_tag)
1213	(prog_lookup_by_service): Remove.
1214	(progman_cleanup): Fix coredump (premature free).
1215	(progman_stop_component): If component is a listener, deactivate it.
1216	(prog_activate_listener)
1217	(prog_deactivate_listener): New functions.
1218	* src/socket.c (delete_sockinst): Close the socket descriptor.
1219	* src/sysvinit.c (sysvinit_fifo_handler, create_fifo): Don't close fd,
1220	leave that to deregister_socket.
1221
1222	Improve logging
1223
1224	* src/diag.c: Rewrite.
1225	(vdiagmsg,diagmsg): New functions.
1226	* src/pies.c (main): Set DIAG_REOPEN_LOG for init process.
1227	* src/pies.h (DIAG_REOPEN_LOG): New flag
1228	(DIAG_TO_MASK,DIAG_ALL): New constants.
1229	(diagmsg): New proto.
1230	* src/sysvinit.c: Add log messages in important transition points
1231	(inittrans): Reinitialize logging to syslog upon transition to
1232	normal mode.
1233
12342016-02-17  Sergey Poznyakoff  <gray@gnu.org>
1235
1236	Fix state transitions
1237
1238	* src/pies.c (main): Move call to pies_schedule_children
1239	to inittrans.
1240	* src/progman.c (progman_cleanup): Minor change.
1241	* src/sysvinit.c (enablecomp): Change prog status
1242	to stopped when leaving its runlevel.
1243	(sysvinit_set_runlevel): Raise SIGALRM instead of calling
1244	inittrans directly.
1245	(inittrans): Fix wait logic.
1246
12472016-02-16  Sergey Poznyakoff  <gray@gnu.org>
1248
1249	Associate program's activity flag with prog, instead of with component.
1250
1251	The CF_DISABLED flag is still retained to indicate that the component is
1252	disabled administratively.
1253
1254	* src/prog.h (prog.v.p) <active>: New member.
1255	(IS_ACTIVE_COMPONENT): Use active flag.
1256	* src/comp.c (component_finish): Don't modify component flags.
1257	* src/ctl.c (prog_serialize): Replace attribute "disabled" with
1258	"active".
1259	(fun_stop): Set prog->v.p.active
1260	* src/pies.c (main): Use pies_master_argv to check whether
1261	program name is absolute.
1262	* src/piesctl.c (print_comp): Check "active" attribute.
1263	* src/progman.c (register_prog0): Set prog->v.p.active.
1264	(progman_create_sockets): Remove components if their
1265	socket cannot be opened.
1266	(progman_lookup_tcpmux, prog_open_socket)
1267	(prog_start, progman_start)
1268	(prog_start_prerequisites, react): Operate on prog->v.p.active
1269	to test/change prog's activity state.
1270	* src/sysvinit.c (enablecomp, runlevel_setup_prog): Operate on
1271	prog->v.p.active to test/change prog's activity state.
1272	(demand_prog, IS_RUNNING_DISABLED_PROG): Likewise.
1273
12742016-02-15  Sergey Poznyakoff  <gray@gnu.org>
1275
1276	Implement emergency shell.
1277
1278	* src/pies.c (main): Move init-specific command line
1279	handling to sysvinit_parse_argv.
1280	* src/pies.h (dfl_level): Remove extern.
1281	(sysvinit_parse_argv): New proto.
1282	* src/sysvinit.c (sysvinit_parse_argv): New function.
1283	(sysvinit_begin): Start emergency shell, if requested.
1284
12852016-02-14  Sergey Poznyakoff  <gray@gnu.org>
1286
1287	Fix handling of wait components
1288
1289	* src/pies.h (PIES_COMP_WAIT): Remove.
1290	(PIES_COMP_MASK): Save one bit.
1291	(PIES_CHLD_NONE, PIES_CHLD_CLEANUP)
1292	(PIES_CHLD_WAKEUP): New constants.
1293	(pies_schedule_children): New proto.
1294	(sysvinit_runlevel_setup): Change signature.
1295	* src/pies.c (children_cleanup, got_alarm): Merge into
1296	single static variable children_op. All uses updated.
1297	(pies_schedule_children): New function.
1298	(sig_handler): Update
1299	(main): Don't call ctl_open for init process.  It is done
1300	by inittrans after transition from boot to normal state.
1301	Update to use pies_schedule_children.
1302	* src/prog.h (IS_ACTIVE_COMPONENT): New macro.
1303	* src/progman.c (prog_start): Don't modify prog->v.p.wait.
1304	(progman_wake_sleeping): Start usual components only after
1305	all "wait" components have terminated.
1306	(progman_cleanup): If a "wait" component has terminated,
1307	request PIES_CHLD_WAKEUP.
1308	* src/sysvinit.c (enstate) <wait>: Remove.
1309	(enablecomp): Update.
1310	(runlevel_setup_prog): Set prog->v.p.wait.
1311	(sysvinit_runlevel_setup): Take only one parameter.
1312	(inittrans): Remove "wait" and the related mess.
1313	Call ctl_open after transition boot -> normal.
1314
13152016-02-13  Sergey Poznyakoff  <gray@gnu.org>
1316
1317	Stop disabled components when switching runlevels.
1318
1319	* src/prog.h (status_enabled, status_disabled): Remove.
1320	(status_stopped, status_running): New modes.
1321	All uses updated.
1322	* src/comp.c (component_finish): Disable ondemand component
1323	by default.
1324	* src/ctl.c (json_object_set_bool): New function.
1325	(pies_status_str): Update.
1326	(prog_serialize): Set "disabled" attribute.
1327	(fun_stop, fun_start): Use CF_DISABLED flag.
1328	(res_runlevel): Schedule ACTION_RELOAD.
1329	* src/pies.h (json_object_set_bool): New proto.
1330	* src/piesctl.c (status_trans): Reflect changes in modes.
1331	(print_comp): Check the "disabled" attribute.
1332	* src/progman.c (register_prog0)
1333	(prog_open_socket,prog_start,prog_stop)
1334	(progman_wake_sleeping)
1335	(prog_start_prerequisites)
1336	(react, progman_cleanup)
1337	(progman_stop_component): Update.
1338	(no_children_left): Fix.
1339	* src/sysvinit.c (enablecomp): Make CF_DISABLED flag
1340	persist for ondemand components.
1341	(runlevel_setup_prog): Use CF_DISABLED flag.
1342	(inittrans): Stop inactivated processes.
1343
1344	* doc/pies.texi: Update.
1345
1346	Implement on-demaind components; implement control socket telinit interface.
1347
1348	* src/pies.h: Include json.h
1349	(sysvinit_report, sysvinit_set_runlevel)
1350	(json_object_set_string, json_object_set_number): New protos.
1351	* src/ctl.c (ctlio_resource)<predicate>: New member.
1352	(restab): New endpoint: runlevel.  Available only if run
1353	as pid 1.
1354	(find_resource): If predicate is not NULL, call it to
1355	confirm that the endpoint is available.
1356	* src/piesctl.c: New subcommand "telinit".
1357	* src/sysvinit.c (sysvinit_set_runlevel): New function.
1358	(sysvinit_fifo_handler): Implement on-demaind components.
1359
1360	Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/pies
1361
13622016-02-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1363
1364	Improve progman API (progman_foreach and progman_stop_component).
1365
1366	* src/progman.c (progman_foreach): Allow filter to remove its prog
1367	argument from the list.  Return integer (result of the call
1368	to filter, that returned non-zero).  All uses changed.
1369	(progman_running_count): Remove.
1370	(progman_stop_component): Take a pointer to
1371	pointer.  Pass it to destroy_prog when needed.  All uses changed.
1372	* src/comp.c (prog_is_leftover): New function.
1373	(cb_terminate_prog): Use prog_is_leftover. Don't raise CF_DISABLED
1374	flag, as prog will have been destroyed by progman_stop_component.
1375	(cb_kill_prog): Use prog_is_leftover.
1376	* src/ctl.c (fun_stop): Check if prog still exists after the
1377	call to progman_stop_component.
1378	* src/pies.h (progman_running_count): Removed.
1379	* src/prog.h (progman_foreach): Return int.
1380	(progman_stop_component): Change signature.
1381
13822016-01-31  Sergey Poznyakoff  <gray@gnu.org>
1383
1384	Update POTFILES.in
1385
1386	Support sysvinit ondemand components.
1387
1388	* src/ctl.c (fun_start): Handle status_finished same as
1389	status_sleeping (for restarting ondemand components).
1390	* src/progman.c: Respawn ondemand components.
1391	* src/sysvinit.c (enablecomp): Handle pies_comp_ondemand.
1392	(sysvinit_demand): New function.
1393	(sysvinit_fifo_handler): Handle ondemand runlevels.
1394	(inittab_parse): Support "off" fields.
1395	Convert runlevels to upper case.
1396
1397	Fix runlevel switching; handle powerfail commands.
1398
1399	* src/ctl.c (prog_serialize): List runlevels.
1400	* src/pies.c (main): Set got_alarm after reloading configuration.
1401	Handle ACTION_POWER.
1402	* src/pies.h (ACTION_POWER): New constant.
1403	(progman_running_p): Rename to progman_waiting_p. All uses changed.
1404	(sysvinit_power): New proto.
1405	(POWER_STAT_FILE): New define.
1406	(POWER_STAT_FAIL,POWER_STAT_LOW,POWER_STAT_OK): New constants.
1407	* src/prog.h (prog) <idx>: Remove.
1408	(prog) <wait>: New member.
1409	* src/progman.c (prog_lookup_by_idx): Remove.
1410	(progman_waiting_p): Return 1 only if there is at least one
1411	prog with v.p.wait set.
1412	(prog_start): Initialize v.p.wait for sysvinit components.
1413	(progman_start): Don't do anything if waiting for components from
1414	the previous runlevel.
1415	(progman_wake_sleeping): Likewise.
1416	(progman_cleanup): Assume expect_term if waiting for components from
1417	the previous runlevel.
1418	Clear v.p.wait on exited progs.
1419	* src/sysvinit.c (sysvinit_fifo_handler): Don't call progman_stop
1420	when handling runlevel changes.
1421	Handle INIT_CMD_POWERFAIL, INIT_CMD_POWERFAILNOW, and
1422	INIT_CMD_POWEROK.
1423	(sysvinit_sigtrans): Handle SIGPWR.
1424	(is_comp_wait): Rewrite.
1425	(power_stat_file): New variable.
1426	(sysvinit_power): New function.
1427
14282016-01-30  Sergey Poznyakoff  <gray@gnu.org>
1429
1430	Fix configuration reload and telinit q
1431
1432	* src/comp.c (component_link): Always link after the REF.
1433	component. If REF is NULL, link at list head.
1434	(component_append): New function.
1435	(component_create): Use component_append.
1436	(component_free): Fix double-free.
1437	* src/pies.c (pies_reload): Call sysvinit_runlevel_setup.
1438	* src/progman.c (progman_stop_component): Remove inactive
1439	components.
1440	* src/sysvinit.c (sysvinit_fifo_handler): Schedule ACTION_RELOAD.
1441	on receiving INIT_CMD_RUNLVL.
1442	(sysvinit_sigtrans): Don't handle SIGHUP.
1443
14442016-01-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1445
1446	Fix grecs version
1447
1448	Bugfix
1449
1450	* src/comp.c (component_link): Restore "next" link.
1451
14522016-01-21  Sergey Poznyakoff  <gray@gnu.org>
1453
1454	Cleanup: redo configuration file handling and dependency tracking.
1455
1456	Implement clean configuration reload on SIGHUP.
1457	Use SIGUSR1 to restart the program (previously initiated by SIGHUP).
1458
1459	* src/Makefile.am (pies_SOURCES): Add comp.c
1460	* src/comp.c: New file.
1461	* src/acl.c (pies_acl_free): Don't coredump on NULL arg.
1462	(_parse_from): Set cmp function for the sockaddr list.
1463	(_acl_common_section_parser): Set cmp function for the ACL
1464	(pies_acl_cmp): New function.
1465	* src/acl.h (pies_acl_cmp): New proto.
1466	* src/cmdline.opt: Remove option --dump-prereq. Add options
1467	--trace-prereq and --trace-depend.
1468	* src/ctl.c: Use prog_tag to access tag of struct prog.
1469	* src/depmap.c (depmap_clear)
1470	(depmap_clear_all): New functions.
1471	* src/inetd.c (inetd_conf_file): Don't register prog right
1472	away.  This is done later in component_config_commit.
1473	(inetd_parse_conf): Rename to inetd_config_parse.
1474	* src/limits.c (limits_cmp): New function.
1475	* src/pies.c (config_file): Replace with struct config_syntax.
1476	(str_to_config_syntax): Return a pointer to struct config_syntax.
1477	(add_config): Rename to config_file_add.
1478	(config_file_add_type): New function.
1479	(return_code_keywords, create_action): Change handling of actions.
1480	(return_code_section_parser): Likewise.
1481	(component_verify, component_create)
1482	(component_free, component_finish): Move to comp.c
1483	(config_parse): Remove.
1484	(pies_config_parse): New function.
1485	(pies_read_config,pies_reload): New function.
1486	(pies_reload): Rename to request_reload.
1487	(pies_status): Rename to request_status.
1488	(pies_stop): Rename to request_stop.
1489	(main): Change configuration file handling.
1490	SIGHUP reloads configuration, instead of restarting the program.
1491	(default_sigv,sig_handler): Handle SIGUSR1.
1492	* src/pies.h (component): New members: prev, next, listidx, arridx,
1493	ref_count, prog.
1494	Remove act_head, act_tail, act_temp.
1495	Add new prototypes.
1496	* src/prog.h (prog): Remove tag and prereq.
1497	* src/progman.c (prog_tag): New function.
1498	(destroy_prog): Update component reference count.
1499	(register_redir): Likewise.
1500	(register_prog0): Take one argument.
1501	Update component reference count.
1502	(register_prog): Update comp->prog
1503	(prog_rebuild_prerequisites): Remove.
1504	(component_fixup_depend): Remove.
1505	(fixup_prerequisites,rebuild_prerequisites)
1506	(print_dep,progman_dump_prereq)
1507	(progman_dump_depmap,progman_build_depmap): Remove.
1508	(prog_start_prerequisites): Scan depmap to find prerequisites.
1509	(prog_stop_dependents): Likewise.
1510	(progman_wait): Remove.
1511	(progman_wait_until): New function.
1512	(progman_stop): Rewrite using progman_wait_until.
1513	(react): Rewrite using grecs_list
1514	* src/sysvinit.c: Use prog_tag when needed.
1515	* src/userprivs.c (pies_privs_cmp, pies_privs_free): New functions.
1516
1517	* grecs: Update.
1518
1519	* lib/safe_strcmp.c: New file.
1520	* lib/Makefile.am: Add safe_strcmp.c
1521	* lib/libpies.h (safe_strcmp): New proto.
1522
15232016-01-10  Sergey Poznyakoff  <gray@gnu.org>
1524
1525	Minor changes in message wording
1526
1527	Improvements in init mode
1528
1529	* src/progman.c (print_status): Suppress output if running
1530	as init process, unless in debug mode.
1531	* src/sysvinit.c (sysvinit_begin): Set up "non-failing"
1532	memory allocation.
1533
15342016-01-09  Sergey Poznyakoff  <gray@gnu.org>
1535
1536	Bugfix
1537
1538	Minor improvements
1539
1540	* src/ctl.c (ctl_open): Return immediately if
1541	control.url is null.
1542	(fun_start): Start sleeping component.
1543	* src/meta1lex.h: Removed.
1544	* src/pies.c (config_parse): Move creation of the default
1545	control.url to main.
1546
1547	Update POTFILES.in
1548
1549	Use grecs meta1 parser
1550
1551	* configure.ac (GRECS_SETUP): Require parser-meta1
1552	* grecs: Upgrade.
1553	* po/POTFILES.in: Update.
1554	* src/Makefile.am: Remove meta1gram.y and meta1lex.l
1555	Add meta1parse.c and meta1parse.h
1556	* src/meta1gram.y: Remove.
1557	* src/meta1lex.l: Remove.
1558	* src/meta1parse.c: New file.
1559	* src/meta1parse.h: New file.
1560	* src/pies.c: Include meta1parse.h instead of meta1lex.h
1561
1562	Bugfixes
1563
1564	* src/meta1gram.y: Translate "wait" mode to "exec".
1565	* src/diag.c (logmsg_vprintf): Don't loose the last segment before \n.
1566
1567	piesctl: optionally bind to local IP
1568
1569	* configure.ac (GRECS_SETUP): Request sockaddr-list
1570	* grecs: Upgrade.
1571	* po/POTFILES.in: Remove meta.c
1572	* src/piesctl-cl.opt: Use client.url
1573	* src/piesctl.c (client_conn): New struct.
1574	(instance_keywords,piesctl_keywords): New keyword: "source".
1575	(parse_config): Initialize grecs_sockaddr_hints.
1576	(shttp_connect): Optionally bind to the selected local IP
1577	before connecting.
1578
1579	* src/utmp.c (write_wtmpx,write_utmpx): Remove spurious notice.
1580
15812016-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1582
1583	Uniformly use grecs memory management functions.
1584
1585	* gnulib.modules: Remove unneded modules.
1586	* ident/ident.h: Remove xalloc.h, include errno.h
1587	* ident/ident.c: Use standard allocation functions instead of x*
1588	* ident/pam.c: Remove.
1589	* ident/provider.c: Remove.
1590	* ident/system.c: Remove.
1591
1592	* src/meta.c: Remove.
1593	* src/Makefile.am: Remove meta.c
1594	* src/progman.c: Use grecs_* allocation functions instead of x*.
1595	(notify): Use wordsplit to expand variables within message.
1596	Rename variables: program-name to program_name;
1597	canonical-program-name to canonical_program_name.
1598
1599	* doc/pies.texi: Update.
1600
1601	* src/depmap.c: Use grecs_* allocation functions instead of x*.
1602	(depmap_end): New function.
1603
1604	* src/diag.c (logmsg_vprintf): Use grecs_txtacc instead of obstack.
1605	* src/pies.h (depmap_end): New proto.
1606	Remove unused includes.
1607
1608	* src/acl.c: Use grecs_* allocation functions instead of x*.
1609	* src/ctl.c: Likewise.
1610	* src/inetd.c: Likewise.
1611	* src/limits.c: Likewise.
1612	* src/meta1gram.y: Likewise.
1613	* src/meta1lex.l: Likewise.
1614	* src/pies.c: Likewise.
1615	* src/socket.c: Likewise.
1616	* src/sysvinit.c: Likewise.
1617	* src/userprivs.c: Likewise.
1618
1619	Enable control socket when run as init process.
1620
1621	* configure.ac (DEFAULT_CONTROL_URL): Rename to
1622	DEFAULT_PIES_CONTROL_URL.  Change default value.
1623	(DEFAULT_INIT_CONTROL_URL): New subst variable.
1624	* lib/libpies.h (pies_basic_url_create): New prototype.
1625	* lib/url.c (pies_basic_url_create): New function (renamed
1626	from pies_url_create).
1627	(pies_url_create): Expand variable references in the input string.
1628	* src/Makefile.am (AM_CPPFLAGS): Pass DEFAULT_INIT_CONTROL_URL
1629	* src/ctl.c (pies_control_url)
1630	(ctl_open): Don't exit on errors, return -1 instead.
1631	* src/pies.c (default_control_url): New variable.
1632	(config_parse): Create default socket url.
1633	(pies_control_url): New macro
1634	(main): Set environment variable PIES_INSTANCE.
1635	Try to open control socket in init process mode as well.
1636	* src/pies.h (default_control_url): New extern.
1637	(ctl_open): Change prototype.
1638	(pies_control_url): Remove.
1639	* src/piesctl-cl.opt (parse_options): Set environment variable
1640	 PIES_INSTANCE.
1641	* src/piesctl.c (parse_config): Use pies_url_create and
1642	DEFAULT_PIES_CONTROL_URL when falling back to the default socket.
1643
1644	Bugfix
1645
1646	* lib/addrfmt.c (S_UN_NAME): Fix comparison.
1647	(sockaddr_to_str): Improve wording.
1648
16492016-01-08  Sergey Poznyakoff  <gray@gnu.org>
1650
1651	Bugfixes
1652
1653	* bootstrap.conf (bootstrap_epilogue): Declare the package as a
1654	GNU one.
1655	* configure.ac: Require gettext 0.19
1656	Remove useless conditional
1657	* src/ctl.c (fun_stop, fun_start): Check prog->v.p.status, not the
1658	CF_DISABLED flag.
1659
16602016-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>
1661
1662	Revert to pre-32a337f3 two endpoint system
1663
16642016-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1665
1666	control interface: pass JSON as query for GET, DELETE, and PUT
1667
1668	piesctl: normalize exit codes.
1669
1670	* src/piesctl.c (EX_OK, EX_NOTFOUND): New defines.
1671	(exit_status): New global.
1672	(all calls): Use EX_OK instead of literal 0
1673	(shttp_process): Set exit_status on errors.
1674	(com_list, com_id): Return void.  Check response code.
1675	(com_stop, com_start)
1676	(com_restart, com_reboot): Return void.
1677	(ctlcom_t): Return void.
1678	(main): Return exit_status
1679
1680	Include argv in the output of ctl id command.
1681
1682	* ctl.c (res_instance): Include "argv" in the return json.
1683	Use pies_master_argv[0] to report binary path.
1684	* pies.c (pies_master_argv,pies_master_argc): New globals.
1685	(main): Initialize them.
1686	Refuse to restart unless argv[0] begins with a slash.
1687	* pies.h (pies_master_argv,pies_master_argc): New globals.
1688	* piesctl.c (com_id): Rewrite output formatting.
1689
1690	Minor changes.
1691
1692	* src/ctl.c (ctlio_authenticate): Configurable realm name.
1693	(ctlio_do_command): Check the Accept header.
1694	* src/inetd.c (inetd_conf_file): Change line_no type.
1695	* src/pies.c (control_keywords): New keyword: realm.
1696	* src/pies.h (control) <realm>: New member.
1697
1698	Insert missing _() markers
1699
1700	Select components to operate upon using conditional expression
1701
1702	* grecs: Upgrade.
1703	* src/ctl.c (restab): Split /programs in two endpoints.
1704	(eval_env): New members allowed_state, fun, total_count,
1705	success_count, and noperm_count.
1706	(pcond_type): pcond_and and pcond_or can take arbitrary
1707	number of arguments.  All uses updated.
1708	(selector): Rewrite.
1709	* src/piesctl.c: All commands that operate on components take
1710	conditional expression as argument.
1711	(pcond_parse_and)
1712	(pcond_parse_or): Optimize consecutive operations.
1713
17142016-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1715
1716	Redo URI handling.
1717
1718	* src/ctl.c (res_instance)
1719	(res_programs): Take partial URI as argument (instead of full
1720	URI split on path delimiter)
1721	(ctlio_resource): New member uri_len; Change signature of handler.
1722	(find_resource): Compare URI prefix.
1723	(ctlio_do_command): Redo URI parsing. Improve error checking.
1724	* src/piesctl.c (shttp_print_error): New function.
1725	(shttp_fatal): Print error on 404 and 409 responses.
1726
1727	Minor fixes
1728
1729	* src/ctl.c: Start textual descriptions with capital letters.
1730	* src/piesctl-cl.opt: Fix typos.
1731	* src/piesctl.c (shttp_process): Fix error handling.
1732	(shttp_fatal): Select exit code depending on the HTTP response code.
1733
17342016-01-04  Sergey Poznyakoff  <gray@gnu.org>
1735
1736	Improve piesctl help output
1737
1738	* src/piesctl.c (comtab): New members: argdoc and docstr.
1739	(command_help): New function.
1740	(main): Set proginfo.print_help_hook
1741	* po/POTFILES.in: add missing files.
1742
17432016-01-03  Sergey Poznyakoff  <gray@gnu.org>
1744
1745	Minor changes
1746
1747	Minor changes
1748
1749	* configure.ac: Version 1.2.92
1750	* src/ctl.c (ctlio_finalize_reply): Don't close connection on errors.
1751	* src/pies.h (PIES_PRINTFLIKE): New macro.
1752	(logmsg, logmsg_printf): Mark as printflike.
1753
17542016-01-02  Sergey Poznyakoff  <gray@gnu.org>
1755
1756	Switch to new control interface.
1757
1758	Old control options (--status, --restart-components) rewritten using
1759	piesctl.
1760
1761	SIGUSR1 and SIGUSR2 no longer handled.
1762
1763	* lib/arraymember.c (array_index): New function.
1764	* lib/libpies.h: Likewise.
1765	* src/cmdline.opt: Fix copyright years.
1766	* src/piesctl-cl.opt: Likewise.
1767	* src/ctl.c (ctlio_do_command): Implement restart.
1768	(pies_control_url): New function.
1769	(eval_env): rename json to result.
1770	New member cond.
1771	Restore pcond_ functions.
1772	(json_to_pcond): New function.
1773	(res_programs): Conditional selection of programs to list.
1774	Implement restart.
1775	* src/pies.c (ctlfile, statfile): Remove.
1776	(pies_keywords): Mark control-file and stat-file as inactive.
1777	(default_sigv): Remove SIGUSR1 and SIGUSR2
1778	(pies_check_status): Don't send SIGUSR2.
1779	(stop_components): Remove.
1780	(request_restart_components): Rewrite as a wrapper.
1781	Call piesctl to do the job.
1782	(list_components): New function.
1783	* src/pies.h (ACTION_COMPRELOAD)
1784	(ACTION_DUMPSTATS): Remove. All callers changed.
1785	(progman_dump_stats): Remove.
1786	* src/piesctl.c (shttp_request_send): Don't initialize conn->req; the
1787	caller is responsible for that.
1788	(parse_condition, json_to_string)
1789	(parse_condition_to_uri): New functions.
1790	(com_list): Read conditional expression from the command line.
1791	(com_restart): Implement.
1792	* src/progman.c (progman_dump_stats): Remove.
1793
1794	piesctl: Implement all basic commands, except "restart"
1795
17962015-12-31  Sergey Poznyakoff  <gray@gnu.org.ua>
1797
1798	Command-line control interface.
1799
1800	* configure.ac (DEFAULT_CONTROL_URL): New subst variable.
1801	* grecs: Upgrade.
1802	* ident/pam.c (overwrite_and_free): Free ptr.
1803	* lib/Makefile.am: Add new sources.
1804	* src/addrfmt.c: Move to lib/addrfmt.c
1805	* lib/grecsasrt.c: New file.
1806	* lib/grecsasrt.h: New file.
1807	* lib/mkfilename.c: New file.
1808	* lib/netrc.c: New file.
1809	* lib/pp.c: New file.
1810	* lib/split3.c: New file.
1811	* src/url.c: Move from lib/url.c
1812	(pies_url_free_user, pies_url_free_passwd): New finctions.
1813	* lib/libpies.h (strsplit3): New proto.
1814	(pies_url_create, pies_url_destroy)
1815	(pies_url_get_arg, pies_url_copy)
1816	(pies_url_free_user, pies_url_free_passwd)
1817	(netrc_scan)
1818	(pp_add_option, pp_command_line, mkfilename)
1819	(sockaddr_to_str, sockaddr_to_astr): New protos
1820	* src/Makefile.am (bin_PROGRAMS): New program: piesctl
1821	 (pies_SOURCES): Remove addrfmt.c and url.c.
1822	(noinst_HEADERS, BUILT_SOURCES): Add piesctl-cl.h
1823	* src/cmdline.opt: Use pp_* function family to build
1824	preprocessor command line.
1825	* src/ctl.c (http_header_hash): Use case-insensitive hashing.
1826	(ctlio_finalize_reply): Don't close connection after sending 401
1827	response.
1828	(input): Remove ws and wsflags.  All uses changed.
1829	(input_append): Use strsplit3 to parse the request line.
1830	* src/pies.c: Use pp_* function family to build
1831	preprocessor command line.
1832	Move assert_, mkfilename and _cb+_url functions into libpies.
1833	* src/pies.h (pies_sockaddr_storage): Move to libpies.h
1834
1835	* src/piesctl.c: New file.
1836	* src/piesctl-cl.opt: New file.
1837
18382015-12-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1839
1840	ctl: use numeric type for PIDS and wakeup time values.
1841
18422015-12-25  Sergey Poznyakoff  <gray@gnu.org>
1843
1844	REST control protocol.
1845
1846	* configure.ac (GRECS_SETUP): Add json
1847	* gnulib.modules: Add base64.
1848	* grecs: Upgrade.
1849	* src/ctl.c: Rewrite as REST.
1850
18512015-12-20  Sergey Poznyakoff  <gray@gnu.org>
1852
1853	Bugfixes in init mode
1854
1855	* src/ctl.c (ctl_open): Add missing return.
1856	* src/pies.c (config_parse): Return if tree is null.
1857	(main) [INIT_EMU]: Print more info. Override default init_fifo.
1858	Don't use syslog and control socket if running as init process.
1859	* src/pies.h (init_fifo): New extern.
1860	* src/progman.c (open_redirector): Return -1 if running as init process.
1861	(prog_start): Always initialize redir[].
1862	* src/sysvinit.c (init_fifo): New variable.  Use it instead if the
1863	INIT_FIFO macro.
1864	(inittrans): Call create_fifo once, when transiting from boot to
1865	normal state.
1866
18672015-12-19  Sergey Poznyakoff  <gray@gnu.org>
1868
1869	Update grecs
1870
18712015-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1872
1873	Fixes
1874
1875	* src/ctl.c: Make "id" command accessible only to
1876	administrators
1877	(cmd_id): Print PID.
1878	(ctlio_do_command): Reword 510 text.
1879	* src/pies.c (config_file): Remove "next"
1880	(conf_head, conf_tail): Remove.  Use grecs_list instead.
1881	All uses changed.
1882
1883	Improve is_group_member functions.
1884
1885	* ident/pam.c: Use is_array_member as intended.
1886	* ident/system.c: Likewise.
1887
1888	Implement user privileges
1889
1890	* src/pies.h (component): New members: list_acl and
1891	adm_acl.
1892	(control): Removed id_acl.
1893	New members: adm_acl and usr_acl.
1894	* src/pies.c (component_keywords): New keywords list-acl and
1895	admin-acl. Removed identity-acl.
1896	* ident/ident.c (pies_identity_user_name): New function.
1897	* ident/identity.h (pies_identity_user_name): New proto.
1898	* src/ctl.c (CTL_USER_STATE,CTL_ADMIN_STATE): New states.
1899	(cmdtab): Mark administrative commands as valid in CTL_ADMIN_STATE
1900	(ctlio_create): Assume CTL_ADMIN_STATE in the absense of identity
1901	providers.
1902	(auth_data): New struct.
1903	(cmd_auth): Select appropriate state depending on the user permissions.
1904	(list_matches): New function.
1905	(eval_env): Keep the list of selected progs.
1906	(count_prog): Removed.
1907	(selector): New function.
1908	(cmd_list): Rewrite to take into account access rights.
1909	(cmd_start,cmd_stop)
1910	(cmd_restart): Only allowed for users with administrative
1911	privileges.
1912
19132015-12-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1914
1915	Minor fixes.
1916
1917	* grecs: Upgrade.
1918	* lib/parsetime.c: Fix senseless compiler warnings.
1919	* src/acl.c: Fix docstrings.
1920	* src/meta1gram.y (yyerror): Change argument
1921	* src/meta1lex.l: Add flex options
1922	* src/pies.h (meta1error): Change signature.
1923	* src/progman.c (prog_lookup_by_socket): Remove.
1924	* src/sysvinit.c (sysvinit_stop_filter): Remove.
1925
1926	Update grecs
1927
19282015-12-16  Sergey Poznyakoff  <gray@gnu.org>
1929
1930	Update gnulib
1931
19322015-12-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1933
1934	Implement authentication on control socket.
1935
1936	* Makefile.am (SUBDIRS): Add src.
1937	* configure.ac: Check for crypt.h and PAM
1938	Build ident/Makefile
1939	* grecs: Update.
1940
1941	* ident/Makefile.am: New file.
1942	* ident/ident.c: New file.
1943	* ident/ident.h: New file.
1944	* ident/identity.h: New file.
1945	* ident/pam.c: New file.
1946	* ident/provider.c: New file.
1947	* ident/system.c: New file.
1948
1949	* lib/Makefile.am: Add arraymember.c
1950	* lib/arraymember.c: New file.
1951	* lib/libpies.h (is_array_member): New proto.
1952
1953	* src/Makefile.am (LDADD): Add libident.a and @PAM_LIBS@
1954	* src/acl.c (acl_entry): Remove groups. Add new members:
1955	names and name_match.
1956	(pies_acl_create): Deep copy the locus.
1957	Set free_entry function for the list.
1958	(pies_acl_free): Free locus.
1959	(_parse_from): Set free_entry function for the list.
1960	(_parse_group): Parse the "user" construct.
1961	(parse_acl_line): Deep copy the locus.
1962	Allow for null value.
1963	(acl_keywords): Update docstrings.
1964	(_acl_check): Rewrite identity checks.
1965	* src/acl.h (acl_input)<user,groups>: Remove.
1966	<identity>: New member.
1967	(pies_acl_free): New proto.
1968	* src/ctl.c (identity): New global.
1969	(cmdtab): New command: auth
1970	(ctlio) <addr,addrlen>: New members.
1971	(ctlio_create): Start from authenticated state
1972	only if no identity_providers are configured.
1973	(cmd_auth): New function.
1974	(cmd_help): Print only commands that are available
1975	in the current state.
1976	(ctl_accept): Initialize io->addr and io->addrlen.
1977	* src/inetd-bi.c: Change call to check_acl
1978	* src/pies.c: Include identity.h
1979	(control_keywords): New statement "identity-acl"
1980	(pies_keywords): New statement "identity-provider"
1981	(config_init): Register identity mechanisms.
1982	(config_parse): New function.
1983	(config_help): Print help on identity-provider
1984	statements.
1985	(main): Use config_parse to parse grecs-style configurations.
1986	* src/pies.h: Include identity.h
1987	(check_acl): Change argument list.  All callers changed.
1988	(control): Remove acl. Add conn_acl and id_acl instead.
1989	* src/progman.c (check_acl): Change argument list.  Take
1990	identity as the 3rd argument.
1991
19922015-11-25  Sergey Poznyakoff  <gray@gnu.org>
1993
1994	Fix descriptor leak
1995
1996	* src/progman.c (prog_start): Close redirection fd's
1997	* grecs: Upgrade.
1998
19992015-11-22  Sergey Poznyakoff  <gray@gnu.org.ua>
2000
2001	Bugfixes
2002
2003	* src/ctl.c (cmd_reboot, ctl_shutdown): Use code 221 to indicate that
2004	we are going to close clonnection
2005	(ctlwr): Check return from write.
2006	* src/pies.c: Handle SIGPIPE
2007
20082015-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2009
2010	New ctl commands: start, stop, restart, reboot, shutdown.
2011
2012	* src/ctl.c (CTL_ACTION_STATE): New state.
2013	(cmdtab): Add new commands: start, stop, restart, reboot,
2014	shutdown.
2015	(ctlio)<action>: New member.
2016	(ctlio_create): Initialize action.
2017	(list_prog): List scheduled wakeup time for sleeping components.
2018	(cmd_start,cmd_stop)
2019	(cmd_restart,cmd_reboot,cmd_shutdown): New functions.
2020	(ctlwr): Handle CTL_ACTION_STATE.
2021	* src/pies.c (pies_schedule_action): New function.
2022	(stop_components): Use progman_stop_tag().
2023	* src/pies.h (pies_schedule_action, progman_stop_tag): New protos.
2024	(progman_stop_component): Remove.
2025	* src/prog.h (progman_locate, progman_stop_component): New protos.
2026	* src/progman.c (progman_locate): New function.
2027	(progman_cleanup): Set status depending on the CF_DISABLED bit.
2028	(progman_stop_component): Take struct prog* as argument.
2029	(progman_stop_tag): New function.
2030
20312015-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2032
2033	control socket: list types
2034
2035	* src/ctl.c: list prog types and search on them
2036	* src/progman.c (progman_foreach): Iterate over all elements, not
2037	only components.
2038	* src/sysvinit.c (runlevel_setup_prog): Check if prog is a component.
2039
2040	Implement list control command.
2041
2042	* src/ctl.c: Implement list.
2043	* src/prog.h (IS_COMPONENT): New macro (from progman.c)
2044	* src/progman.c: Move IS_COMPONENT to src/prog.h
2045	* src/socket.c (create_socket): Clear uid, gid and umaskval for
2046	inet sockets.
2047
20482015-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2049
2050	Introduce control connection.
2051
2052	* src/ctl.c: New file.
2053	* src/Makefile.am (pies_SOURCES): Add ctl.c
2054	* src/pies.c: New configuration statement "control"
2055	* src/pies.h (instance, ctl_url): New externs.
2056	(register_socket): Change signature.
2057	(update_socket,ctl_open): New protos.
2058	* src/socket.c (listenset): Remove.
2059	(fdset): New static.
2060	(sockinst)<handler>: Array of three pointers: handlers for
2061	read, write, and exception, correspondingly.
2062	(find_socket_handler): Remove.
2063	(register_socket): Take three function pointers as arguments.
2064	Update corresponding elements of fdset.
2065	(update_socket): New function.
2066	(pies_pause): Handle all three I/O operations.
2067	(deregister_socket)
2068	(register_program_socket)
2069	(disable_socket,enable_socket): Reflect the changes.
2070	* src/sysvinit.c (create_fifo): Update call to register_socket.
2071
20722015-08-14  Sergey Poznyakoff  <gray@gnu.org>
2073
2074	Fix doc generation.
2075
2076	The default Config file applies to all output formats, which is wrong.
2077	Use a dedicated configuration file for html output formats, and
2078	defaults for the rest.
2079
2080	* doc/Config: Rename to doc/html.init (with changes).
2081
20822015-03-01  Sergey Poznyakoff  <gray@gnu.org>
2083
2084	Switch to Texinfo 5.0
2085
2086	* doc/Config: Rewrite.
2087	* doc/Makefile.am: Use Makeinfo 5 instead of texi2htm
2088	* doc/gendocs_template: Ps is not built
2089	* imprimatur: Upgrade.
2090
20912015-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2092
2093	New component flag: nullinput
2094
2095	* NEWS: Update.
2096	* doc/pies.texi: Document nullinput flag.
2097	* src/pies.c (str_to_cf): New flag: nullinput
2098	* src/pies.h (CF_NULLINPUT): New flag.
2099	* src/progman.c (prog_start): If CF_NULLINPUT flag is set,
2100	redirect /dev/null to the stdin
2101
21022014-12-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2103
2104	Minor fixes.
2105
2106	* lib/proctitle.c (mf_proctitle_format): Check return from
2107	vasprintf instead of checking the return pointer.
2108	* src/inetd-bi.c: Check return values from write where reasonable.
2109	* src/progman.c (redirect_to_file): Check return from chown.
2110	(close_fds): Fix coredump (upper boundary was wrong).
2111	(open_redirector, progman_dump_stats): Check return values.
2112	* src/sysvinit.c (sysvinit_setenv): Remove unused variable.
2113	* src/userprivs.c (str_eq, str_dispose): Remove unused functions.
2114	* src/utmp.c: Check return values.
2115
21162014-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2117
2118	Implement globbing patterns in include statements.
2119
2120	* grecs: Upgrade.
2121	* doc/pies.texi: Document built-in include and line directives.
2122	* src/cmdline.opt: New option -I (--include-directory).
2123
2124	* configure.ac: Version 1.2.91
2125	* NEWS: Update.
2126
21272014-06-11  Sergey Poznyakoff  <gray@gnu.org>
2128
2129	Init emulator mode; bugfix.
2130
2131	* src/pies.c (main) [INIT_EMU]: Enable "init emulator" mode.
2132	* src/sysvinit.c (enablecomp)
2133	(sysvinit_runlevel_setup): Use struct enstate to pass information
2134	to the callback. This fixes bug introduced by the previous commit,
2135	which caused "wait" keyword to be ignored.
2136
21372014-06-09  Sergey Poznyakoff  <gray@gnu.org>
2138
2139	Implement ctrlaltdel and kbrequest processes.
2140
2141	* src/sysdep.c: New file.
2142	* src/Makefile.am (pies_SOURCES): Add sysdep.c
2143	* src/pies.c (ACTION_*): Move to pies.h
2144	(sig_handler): Call sysvinit_sigtrans, return immediately
2145	if it handles the signal.
2146	(setsigvhan): New function.
2147	(add_extra_sigv): New function.
2148	(signal_setup): Rewrite.
2149	(main): Handle ACTION_CTRLALTDEL and ACTION_KBREQUEST.
2150	* src/pies.h (PIES_COMP_DEFAULT)
2151	(PIES_COMP_WAIT,PIES_COMP_MASK): New defines.
2152	(pies_action): New enum, add new actions: ACTION_CTRLALTDEL
2153	and ACTION_KBREQUEST.
2154	(setsigvhan, add_extra_sigv)
2155	(sysvinit_sigtrans,sysvinit_runlevel_setup)
2156	(sysvinit_sysdep_begin): New protos.
2157	(sysvinit_request) <pad>: Rename to data.
2158	* src/sysvinit.c (enablecomp): Change meaning of the data pointer.
2159	(sysvinit_runlevel_setup): Change signature. Remove static qualifier.
2160	All uses changed.
2161	(sysvinit_setenv): New static.
2162	(sysvinit_fifo_handler): Handle INIT_CMD_SETENV.
2163	(sysvinit_sigtrans): New function.
2164	(sysvinit_begin): Set up new signals.
2165	Call sysvinit_sysdep_begin.
2166
21672013-12-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2168
2169	Upgrade grecs
2170
21712013-01-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2172
2173	Add function for parsing /etc/inittab.
2174
2175	* src/limits.c (free_limits): New function.
2176	* src/pies.c (config_syntax): Move to pies.h
2177	(config_syntax_tab): New type "inittab"
2178	(free_action,component_free): New functions.
2179	(component_finish): Call component_free to discard the
2180	failed component.
2181	(main): In sysvinit mode, default to reading two configuration files:
2182	/etc/inittab and /etc/pies.init.
2183	Don't exit on configuration errors in this mode.
2184	* src/pies.h (str_to_config_syntax)
2185	(add_config,free_redirector)
2186	(component_free,free_limits)
2187	(inittab_parse): New protos.
2188	* src/progman.c (free_redirector): New function.
2189	* src/sysvinit.c (inittab_parse): New function.
2190
2191	Fix sysvinit execution environment, simplify boot state system.
2192
2193	* src/pies.c (_cb_runlevels): Bugfix.
2194	(set_console_dev): Move to sysvinit.c
2195	* src/pies.h (progman_sysvinit_enable): Remove proto.
2196	(console_open, telinit): New protos.
2197	(sysvinit_environ_hint): New extern.
2198	* src/prog.h (prog_stop): New proto.
2199	* src/progman.c (env_concat): Bugfix.
2200	(env_concat): In sysvinit mode, apply sysvinit_environ_hint
2201	to the environment.
2202	(console_open, console_stty): Move to sysvinit.c
2203
2204	* src/sysvinit.c (boot_state): Simplify state set.
2205	(getinitdefault, askrunlevel): New functions.
2206	(sysvinit_runlevel_setup): New function.
2207	(enablecomp): Change signature to match progman_foreach API.
2208	(sysvinit_begin): Prepare console, become a session leader,
2209	prepare environment.
2210	(inittrans): Call sysvinit_runlevel_setup
2211
2212	* src/socket.c (calc_fd_max): Fix return type.
2213	* src/acl.c (acl_copy): Remove unused variable.
2214
22152013-01-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2216
2217	Update copyright years.
2218
2219	Fix runlevel transition algorithm, implement SysV-style fifo interface.
2220
2221	* src/prog.h: New file.
2222	* src/Makefile.am: Add new file.
2223	* src/cmdline.opt: New option --telinit (-T).
2224	* src/diag.c (vlogmsg): In sysvin it mode, write
2225	directly to the console. Close it when finished.
2226	* src/pies.c (_cb_initdefault, _cb_runlevels): Use is_valid_runlevel
2227	to check if the specified runlevels are ok.
2228	(main): In sysvinit mode, reset action to ACTION_CONT.
2229	* src/pies.h (progman_filter): New proto.
2230	(progman_accept,register_socket): Change signature.
2231	(deregister_socket): New proto.
2232	(register_program_socket): New proto.
2233	* src/progman.c: Move constant and adatatype definitions to
2234	prog.h
2235	(prog_stop): Remove static qualifier.
2236	(console_open): Likewise.
2237	(progman_accept): Use new socket API.
2238	(progman_stop): Correctly handle timeouts.
2239	(progman_foreach): New function.
2240	* src/socket.c: Register all sockets along with their handlers
2241	in a doubly-linked list.
2242	(sockinst): New struct.
2243	(register_socket,deregister_socket): New functions.
2244	(register_program_socket): New function.
2245	(pies_pause): Traverse the list to find which fd has changed.
2246	Use its registered handler to handle the event.
2247	* src/sysvinit.c: Include prog.h
2248	(is_valid_runlevel): New function.
2249	(sysvinit_fifo_handler,check_fifo): New static functions.
2250	(inittrans): Fix transition algorithm.
2251	(telinit): New function.
2252
22532013-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2254
2255	Write utmp/wtmp records in sysvinit mode.
2256
2257	* configure.ac: Check for utmp.h, utmpx.h
2258	* src/utmp.c: New file.
2259	* src/Makefile.am: Add utmp.c
2260	* src/pies.h (sysvinit_acct): New proto.
2261	* src/progman.c (prog_start, progman_cleanup): Call sysvinit_acct.
2262	* src/sysvinit.c (inittrans): Call sysvinit_acct.
2263	Set proctitle.
2264
22652013-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2266
2267	Fix sysvinit transition logic.
2268
2269	* src/pies.c (main): Call sysvinit_begin to initialize
2270	sysvinit subsystem.
2271	In the main loop, force wakeup if inittrans returns 1.
2272	* src/pies.h (is_sysvinit): Rewrite macro.
2273	(progman_sysvinit_enable): New proto.
2274	(inittrans): Change return type.
2275	* src/progman.c (progman_sysvinit_enable): New function.
2276	(progman_running_p): Additional debugging.
2277	(prog_start): Special handling for sysvinit components.
2278	Remove calls to runlevel_match
2279	* src/sysvinit.c (runlevel_match): Remove function.
2280	(sysvinit_begin): New function.
2281	(inittrans): Return boolean value indicating whether a
2282	transition has been made. Call progman_sysvinit_enable to
2283	change the status of sysvinit components as appropriate.
2284
2285	Minor fixes.
2286
2287	* src/pies.c (modetab): Discern between "wait" and "respawn".
2288	* src/progman.c (progman_cleanup): Mark a terminated sysvinit
2289	component as status_finished.
2290
2291	Fix grecs usage
2292
2293	Implement runlevel transitions.
2294
2295	* src/sysvinit.c: New file.
2296	* src/Makefile.am: Add new file.
2297	* src/pies.c (initdefault, dfl_level): Move to sysvinit.c
2298	(modetab): Add new modes.
2299	(inittrans): Move to sysvinit.c
2300	* src/pies.h (is_sysvinit): New macro.
2301	(dfl_level): New extern.
2302	(runlevel_match, inittrans, is_comp_wait): New protos.
2303	* src/progman.c (progman_running_p): Take into account only
2304	components. Use is_comp_wait to determine if the component
2305	should be waited for.
2306	(prog_start): Run sysvinit components only when started as
2307	init process.
2308	(runlevel_match): Move to sysvinit.c
2309	(prog_start_prerequisites): Return immediately if
2310	the component is disabled.
2311
2312	Initial support for running as init process.
2313
2314	* grecs: Upgrade.
2315	* lib/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
2316	* src/Makefile.am: Likewise.
2317	* src/acl.c: Update grecs_keyword definitions.
2318	* src/inetd.c (inetd_conf_file): Bugfix. The ws structure could
2319	be free'd prior to initialization.
2320	* src/pies.c: Update grecs_keyword definitions.
2321	(init_process,initdefault,dfl_level): New globals.
2322	(modetab) <once>: New keyword.
2323	(component_keywords)<runlevels,initdefault>: New keywords.
2324	(main): Initial support for init(8) mode.
2325	* src/pies.h (pies_comp_mode) <pies_comp_exec_once>: New constant.
2326	(component)<runlevels>: New member.
2327	(init_process,console_device,initdefault): New externs.
2328	* src/progman.c (prog_status)<status_finished>: New status.
2329	(prog)<runlevels>: New member.
2330	(progman_running_p): New function.
2331	(prog_start): Special handling for init process mode.
2332	(progman_start): Likewise. Take into account runlevels.
2333	(progman_dump_stats): New flag 'f' for status_finished.
2334
23352012-12-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2336
2337	Bugfix.
2338
2339	* src/meta1lex.l: Fix mistyped preproc directive.
2340
23412012-07-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2342
2343	Bugfix.
2344
2345	* src/progman.c (prog_stop): Access v.p.comp->flags only
2346	if the argument points to a component.
2347
23482012-07-15  Sergey Poznyakoff  <gray@gnu.org.ua>
2349
2350	Upgrade imprimatur.
2351
23522012-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2353
2354	Fix saturation of the connection table.
2355
2356	* src/progman.c (conn_class_copy): Zero out the source after
2357	copying (fix typo).
2358	(conn_class_lookup): Bail out if grecs_symtab_lookup_or_install
2359	fails.
2360	(conn_class_report): Take two arguments, the first one being
2361	the priority to use for logging.
2362	All uses changed.
2363	(conn_class_remove): New function.
2364	(progman_cleanup): Call conn_class_remove when the number
2365	of connections for that class reaches zero.
2366
23672011-10-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2368
2369	Document siggroup flag.
2370
23712011-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2372
2373	Minor fix.
2374
2375	* doc/Makefile.am (check-options): Change to match the recent changes.
2376
2377	Switch to the latest Grecs.
2378
2379	* Makefile.am (ChangeLog): Use git2chg.awk to build it.
2380	* NEWS: Update.
2381	* bootstrap.conf (gnulib_modules): Grecs does not depend on gnulib any more.
2382	* configure.ac: Version 1.2.90.
2383	Define GRECS_HOST_PROJECT_INCLUDES, remove grecs Makefiles from
2384	AC_CONFIG_FILES: it is now done by GRECS_SETUP itself.
2385	* gnulib.modules (gitlog-to-changelog,argp): Remove.
2386	(configmake): New module.
2387	* grecs: Update to a52ab6c6.
2388	* lib/libpies.h: Remove redefinitions of _() and N_().
2389	* src/Makefile.am: Update for the recent grecs.
2390	* src/acl.c: Rewrite using Grecs support for lists and symtabs.
2391	* src/acl.h: Likewise.
2392	* src/diag.c: Likewise.
2393	* src/inetd.c: Likewise.
2394	* src/meta1gram.y: Likewise.
2395	* src/meta1lex.h: Likewise.
2396	* src/meta1lex.l: Likewise.
2397	* src/pies.c: Likewise.
2398	* src/pies.h: Likewise.
2399	* src/progman.c: Likewise.
2400	* src/userprivs.c: Likewise.
2401
24022011-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2403
2404	Use Imprimatur for docs processing.
2405
2406	* .gitmodules: Add imprimatur.
2407	* Makefile.am (ACLOCAL_AMFLAGS,SUBDIRS): Add imprimatur.
2408	* configure.ac: Require gettext 0.18. Call IMPRIMATUR_INIT.
2409	Define ATTRIBUTE_NORETURN, if not defined already.
2410	* doc/Makefile.am: Use imprimatur. Drop files that are
2411	no longer necessary.
2412	* doc/check-docs.sh: Delete.
2413	* doc/fix-sentence-spacing.sed: Delete.
2414	* doc/mastermenu.el: Delete.
2415	* doc/rendition.texi: Delete.
2416	* doc/untabify.el: Delete.
2417
2418	* doc/pies.texi: Use @: where appropriate.
2419
2420	* src/pies.c (main): Use _() instead of N_().
2421
24222010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2423
2424	Remove pidfile when exiting or restarting.
2425
2426	* src/pies.c (main): Remove pidfile after exiting the
2427	event loop.
2428
24292010-01-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2430
2431	Update copyright years.
2432
2433	Happy GNU Year!
2434
2435	New keyword "siggroup" + bugfix.
2436
2437	* src/pies.c (str_to_cf): New keyword "siggroup".
2438	* src/pies.h (CF_SIGGROUP): New constant.
2439	* src/progman.c (prog_start): Call setsid in child.
2440	(check_stopping): If CF_SIGGROUP, send signal to
2441	the process group.
2442	(prog_stop): If CF_SIGGROUP, send signal to
2443	the process group.
2444	(send_msg,run_command): Call setsid in child.
2445	(progman_cleanup): Bugfix: check if prog->v.p.cclass
2446	is not NULL (it can be, for UDP services).
2447
24482009-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2449
2450	Limit number of connections per socket (IP).
2451
2452	* src/inetd-bi.c (fd_write): Remove. Use fd_report instead.
2453	* src/pies.c (component_keywords): New keywords: max-instances-message,
2454	max-ip-connections, max-ip-connections-message, access-denied-message.
2455	* src/pies.h (struct component): New members: max_ip_connections,
2456	access_denied_message, max_instances_message, max_ip_connections_message.
2457	(fd_report): New extern.
2458	* src/progman.c (conn_class): New struct.
2459	(struct prog.p): New member cclass.
2460	(conn_tab): New static.
2461	(conn_class_lookup, conn_class_report): New functions.
2462	(progman_run_comp): Set cclass.
2463	(fd_report): New function.
2464	(_prog_accept): In case of failure (access denied, etc.)
2465	optionally send response strings over the fd.
2466	Limit number of connections per socket (IP).
2467	(progman_cleanup): Update cclass counter.
2468
2469	Update grecs to edcc575b.
2470
24712009-12-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2472
2473	Bugfixes.
2474
2475	* src/diag.c (vlogmsg): Copy va_list before printing
2476	it to stderr.
2477	* src/progman.c (print_status): First arg is const.
2478
24792009-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>
2480
2481	Handle multiple MeTA1 servers.
2482
2483	* src/meta1gram.y: Handle multiple MeTA1 servers with
2484	different tags.
2485
24862009-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2487
2488	Minor fixes.
2489
2490	* src/Makefile.am: Fix rules for inetd.
2491
24922009-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2493
2494	Final cleanup for version 1.2.
2495
2496	* configure.ac (INETD_SH): Rename to INETD.
2497	* NEWS: Update.
2498	* src/.gitignore (inetd.sh): rename to inetd.
2499	* doc/pies.texi: Update.
2500	* src/Makefile.am (pkgstatedir): New variable.
2501	(AM_CPPFLAGS): Add define.
2502	(inetd.sh): Replace with inetd.
2503	(install-exec-hook): Remove.
2504	* src/pies.c (statedir): New variable.
2505	(pies_keywords): New keyword: "state-directory".
2506	(set_file_names): Split in two functions:
2507	(set_conf_file_names, set_state_file_names).
2508	(main): Call set_conf_file_names before,
2509	and set_state_file_names after parsing the configs.
2510
2511	Finish the docs.
2512
2513	* doc/inetd.texi: Update.
2514	* doc/pies.texi: Update.
2515
2516	New meta-variable for notifications.
2517
2518	* src/progman.c (notify): New meta-var "instance".
2519
2520	Bugfixes.
2521
2522	* src/meta1gram.y (xlat_listen_socket): Handle
2523	all relevant assignments in the listen_socket block.
2524	* src/url.c (url_parse_host): Always assign port_s.
2525	Handle arguments without preceding path.
2526	(url_parse_user): Parse path without preceding
2527	user/pass specs.
2528	(url_parse_scheme): Require exactly two slashes
2529	after 'scheme:'.
2530
25312009-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2532
2533	Document state files and instances.
2534
2535	* doc/pies.texi: Update.
2536
2537	Improve status output.
2538
2539	* doc/pies.texi: Document new status output format.
2540	* src/progman.c (progman_dump_stats): Redesign flags column.
2541
2542	Upgrade grecs.
2543
2544	Improve docs + bugfix.
2545
2546	* doc/inetd.texi: New file.
2547	* doc/Makefile.am: Add inetd.texi.
2548	* doc/pies.texi, doc/usr-acl.texi: Update.
2549	* src/pies.c (socktype_xtab): SOCK_PACKET not always defined.
2550
2551	Update
2552
2553	* doc/macros.texi (xprindex)
2554	(example-output, mtasimopt): Remove
2555	(RFC): New macro.
2556	* doc/pies.texi: Document inetd-style components.
2557	* doc/Makefile.am (fix-sentence-spacing): Fix rule.
2558	* src/progman.c (progman_lookup_tcpmux): Use case-insensitive
2559	comparison, as required by RFC.
2560
25612009-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2562
2563	Improve docs.
2564
2565	* doc/fix-sentence-spacing.sed: New file.
2566	* doc/Makefile.am (EXTRA_DIST): Add fix-sentence-spacing.sed.
2567	(check-tabs, check-sentence-spacing)
2568	(fix-sentence-spacing): New rules.
2569	(check-format): Rewrite rule.
2570	* doc/pies.texi: Update.
2571
25722009-12-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2573
2574	Minor changes
2575
2576	* doc/pies.texi: Update
2577	* src/progman.c (run_command): handle return-code for inetd components.
2578
25792009-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2580
2581	New option --instance.
2582
25832009-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2584
2585	Optionally provide an inetd wrapper.
2586
2587	* configure.ac: New option --enable-inetd
2588	* src/inetd.in: New file.
2589	* src/.gitignore: Add inetd.sh.
2590	* src/Makefile.am (inetd.sh): New goal.
2591	(install-exec-hook): New rule.
2592
2593	Handle per-tcpmux ACL's. Optionally pass socket data via environment variables.
2594
2595	* src/inetd-bi.c (tcpmux): Consult the component's ACL
2596	before deciding whether to handle the connection.
2597	* src/pies.c (str_to_socket_type): Rewrite using
2598	strtotok.
2599	(socket_type_to_str): New function
2600	(str_to_cf): New flags: sockenv and
2601	resolve. Use strtotok.
2602	(main): Log_tag defaults to program instance name.
2603	* src/pies.h: Include socket-related headers.
2604	(CF_SOCKENV, CF_RESOLVE): New flags.
2605	(pies_sockaddr_storage): New union.
2606	(check_acl): New proto.
2607	(progman_run_comp): Change signature.
2608	(socket_type_to_str): New proto.
2609	* src/progman.c (struct prog): New members sa_storage,
2610	sa_len.
2611	(prog_sockenv): New function.
2612	(progman_run_comp): Call prog_sockenv.
2613	Initialize sa_storage and sa_len of the created
2614	struct prog.
2615	(prog_start): Call prog_sockenv.
2616	Do not close 2 if logging to stderr.
2617	(check_acl): Remove static.
2618	(_prog_accept): Use union pies_sockaddr_storage.
2619	Pass socket address in pinst->v.p.sa_storage and
2620	pinst->v.p.sa_len.
2621	(sockenv_hint, envsize): New variables.
2622	(add_env): New function.
2623	(env_setup): Remove.
2624	(environ_setup): New function.
2625	* src/socket.c: Remove unnecessary includes.
2626
26272009-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2628
2629	Switch to grecs master.
2630
2631	Fix config-help output
2632
2633	Implement internal inetd services in the pies config.
2634
2635	* src/pies.h (CF_INTERNAL): New flag.
2636	(ISCF_TCPMUX): New macro.
2637	(struct component): Reorder fields.
2638	New field: tcpmux.
2639	(progman_lookup_service): Remove proto.
2640	(progman_lookup_tcpmux): New proto.
2641	(struct inetd_builtin.foo): Change signature. All uses updated.
2642	* src/progman.c (progman_lookup_service): Remove.
2643	(progman_lookup_tcpmux): New function.
2644	(progman_create_sockets): Skip tcpmux subservices.
2645	(progman_start): Skip disabled inetd components.
2646	* src/inetd-bi.c (tcpmux): Use progman_lookup_tcpmux.
2647	* src/inetd.c (tcpmux_service, mktag): New functions.
2648	(inetd_conf_file): Minor changes.
2649	* src/pies.c (_cb_bitmask, _cb_precious)
2650	(_cb_disabled, _cb_wait): Remove.
2651	(str_to_cf, _cb_flags): New functions.
2652	(component_keywords): Remove keywords:
2653	disable, precious, wait.
2654	Add keywords: flags, service, tcpmux-master.
2655	(component_verify): Improve.
2656	* src/url.c (pies_url_destroy): Fix coredump on NULL argument.
2657
2658	Allow to specify several config files in the command line. Change output --status format.
2659
2660	* src/pies.c (instance): New global.
2661	(conffile): Remove.
2662	(pidfile,ctlfile,statfile,qotdfile): Remove initializers.
2663	(config_syntax, config_file): New types.
2664	(conf_head, conf_tail): New variables.
2665	(config_syntax_tab): New variable.
2666	(add_config): New function.
2667	(options): New option --syntax.
2668	(current_syntax): New variable.
2669	(parse_opt): Change handling of -i
2670	(mkfilename, set_file_names): New functions.
2671	(main): Allow to specify several different config files
2672	in the command line.
2673
2674	* src/progman.c (progman_dump_stats): Change
2675	output format.
2676
26772009-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2678
2679	Implement TCPMUX internal service.
2680
2681	* src/pies.h (CF_TCPMUX, CF_TCPMUXPLUS): New flags.
2682	(struct component): New member: service.
2683	(progman_lookup_service, progman_run_comp)
2684	(progman_iterate_comp): New protos.
2685	* src/progman.c (progman_iterate_comp)
2686	(prog_lookup_by_service)
2687	(progman_lookup_service): New functions
2688	(prog_start_prologue, prog_execute): New functions,
2689	extracted from prog_start.
2690	(progman_run_comp): New function.
2691	(prog_start): Replace extracted parts of code with calls
2692	to prog_start_prologue and prog_execute.
2693	* src/inetd-bi.c: Implement TCPMUX
2694	* src/inetd.c (inetd_conf_file): Handle tcpmux extries.
2695
26962009-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2697
2698	Implement inetd builtin services.
2699
2700	* src/inetd-bi.c: New file.
2701	* src/Makefile.am (pies_SOURCES): Add inetd-bi.c.
2702	* src/pies.h (struct component): New member `builtin'.
2703	(qotdfile): New extern.
2704	(inetd_builtin): New struct.
2705	(inetd_builtin_lookup): New proto.
2706	* src/progman.c (prog_start): Handle internal
2707	services.
2708	* src/inetd.c (inetd_conf_file): Handle internal
2709	services.
2710	* src/pies.c (qotdfile): New global.
2711	(pies_keywords): New keyword "qotd-file".
2712
2713	Implement inetd connection rate.
2714
2715	* src/pies.h (struct component): New member "max_rate".
2716	(default_max_rate): New extern.
2717	* src/progman.c (check_rate): New function.
2718	(check_spawn_rate, check_connection_rate): New functions.
2719	(prog_open_socket): New function.
2720	(prog_start): Rewrite using the above functions.
2721	(_prog_accept): Check connection rate.
2722	(progman_start): Special handling for inetd listeners.
2723	(progman_wake_sleeping): Likewise.
2724	* src/pies.c (default_max_rate): New global.
2725	(component_keywords): New keyword max-rate.
2726	(options): New option "rate".
2727	(parse_opt): Handle the new option.
2728	* src/inetd.c (inetd_conf_file): Set max_rate, instead of
2729	max_instances.
2730
2731	Implement parsing of inetd.conf files.
2732
2733	* src/Makefile.am (pies_SOURCES): Add inetd.c.
2734	* src/inetd.c: New file.
2735	* src/pies.c (inetd_mode): New global.
2736	(str_to_socket_type): New function.
2737	(_cb_socket_type): Use str_to_socket_type.
2738	(_cm_include_meta1): Rename to _cb_include_meta1.
2739	(_cb_include_inetd): New function.
2740	(pies_keywords): New keyword "include-inetd".
2741	(options): New option --inetd.
2742	(main): Handle inetd mode.
2743	* src/pies.h (str_to_socket_type): New proto.
2744	(disable_socket, enable_socket): Fix return type.
2745	* src/progman.c (redirect_to_file): Avoid coredump on
2746	privs.user == NULL.
2747	(open_redirector,env_setup)
2748	(progman_start,run_command): Remove unneeded variable.
2749	(progman_start): Fix diagnostic message.
2750	* src/socket.c (disable_socket, enable_socket): Fix return type.
2751	Do nothing if fd < 0.
2752	* src/userprivs.c (switch_to_privs): Allow to pass uid==0.
2753
2754	Handle non-stream sockets. Pies can now replace inetd (- inetd.conf and built-in services).
2755
2756	* src/pies.c (component_keywords): New keywords: wait,
2757	socket-type.
2758	(component_verify): Add more checks.
2759	* src/pies.h (CF_WAIT): New define.
2760	(struct component): New member: socket_type.
2761	(struct pies_url): Rename proto to scheme.
2762	New members: proto, proto_s, port_s
2763	(register_listener): Remove proto.
2764	(register_socket): New proto.
2765	(create_socket): Change signature.
2766	(disable_socket, enable_socket): New protos.
2767	* src/progman.c (close_fds): New function.
2768	(open_redirector): Use close_fds.
2769	(prog_start): Use close_fds.
2770	Update call to create_socket.
2771	Disable socket if wait is set.
2772	(progman_accept): Support non-stream
2773	(and stream+wait) sockets.
2774	(component_fixup_depend): Update call to create_socket.
2775	Call register_socket.
2776	(run_command): Use close_fds.
2777	Re-enable socket if wait is set.
2778	* src/socket.c (create_socket): Take additional argument:
2779	socket_type.
2780	(register_socket): New function.
2781	(disable_socket, enable_socket): New functions.
2782	(pies_pause): Add missing break.
2783	* src/url.c (url_parse_host): Accept service name
2784	and numberic port number.
2785	(url_parse_proto): Rename to url_parse_scheme. All callers
2786	updated.
2787	(url_parse_scheme): Allow for optional
2788	protocol specification in scheme field (after a '+' sign).
2789	(pies_url_destroy): Free new fields.
2790
27912009-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2792
2793	Limit number of instances for inetd-style components.
2794
2795	* src/pies.c (component_keywords): New keyword
2796	`max-instances'.
2797	* src/pies.h (struct component): New member:
2798	max_instances.
2799	* src/progman.c (struct prog): Rename count to
2800	failcount. All uses changed.
2801	New members num_instances and listener.
2802	(progman_accept): Keep track of the number of
2803	instances. Deny connection if it is greater than
2804	max_instances (unless the latter is 0).
2805	(progman_cleanup): Keep track of the number of
2806	instances in inetd listeners.
2807
2808	Minor change.
2809
2810	* src/pies.h (CF_DISABLED)
2811	(CF_PRECIOUS): New defines.
2812	(struct component): Replace precious and
2813	disabled by a bitmask member `flags'. All uses updated.
2814	* src/progman.c: Reflect the above change.
2815	* src/pies.c (_cb_bitmask): New function.
2816	(_cb_precious, _cb_disabled): New callbacks.
2817	(component_keywords): Change handling of precious and disabled.
2818	* bootstrap.conf: Add Emacs mode marker
2819
28202009-11-22  Sergey Poznyakoff  <gray@gnu.org.ua>
2821
2822	Take translations from the TP.
2823
28242009-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2825
2826	Minor change.
2827
2828	* src/depmap.c (struct pies_depmap.nrows,rowlen): Change type
2829	to size_t.
2830	(depmap_alloc, depmap_rowptr)
2831	(depmap_set, depmap_isset)
2832	(depmap_next, depmap_first): Use size_t to index map elements.
2833	* src/pies.h: Update prototypes accordingly.
2834	* src/progman.c: Update depmap function usage.
2835
28362009-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2837
2838	Fix doc/Commit
2839
2840	* doc/Commit (gray_print_section): Output anchors before
2841	chapter/section/etc. titles, so that the heading menu in
2842	monolithic document works properly.
2843
28442009-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2845
2846	Rearrange structures prog and component.
2847
2848	* config_array_to_argv (config_array_to_argv): Take four arguments.
2849	Return argc in the memory location pointed to by the 4th one (unless NULL).
2850	All callers updated.
2851	(_cb_command): Fill both comp->argv and comp->argc.
2852	(component_keywords): Pass pointer to struct component to _cb_command.
2853	* src/pies.h (struct component): New member `argc'.
2854	* src/progman.c (struct prog): Move idx to v.p; change its type to unsigned.
2855	Remove v.p.argc. All uses updated.
2856	(numprog): Rename to numcomp; change type to unsigned.
2857	(prog_lookup_by_idx): Check only elements of type
2858	TYPE_COMPONENT.
2859
2860	Register mailers and `exec' actions in the prog list.
2861
2862	* src/pies.c (return_code_keywords): Fix docstring wording.
2863	* src/progman.c (prog_type): New enum.
2864	(struct prog): New union member `c'.
2865	(IS_PROG): Rename to IS_COMPONENT.
2866	(destroy_prog): Handle TYPE_COMMAND.
2867	(register_command): New function.
2868	(wait_for_child): Remove.
2869	(propagate_child_exit): New function.
2870	(wordsplit_string): New function.
2871	(send_msg): Register command.
2872	In child: Reset all signals; call propagate_child_exit.
2873	(run_command): Do not reset SIGPIPE.
2874	Register command.
2875	(progman_cleanup): Handle TYPE_COMMAND.
2876	(progman_stop_component): For sleeping components, reset
2877	v.p.count.
2878	(progman_dump_stats): Handle TYPE_COMMAND.
2879
2880	Improve diagnostic output.
2881
2882	* src/diag.c (diag_output): New variable.
2883	(diag_setup): New function.
2884	(vlogmsg): Use diag_output to decide where to
2885	output the message. Output to both stderr and
2886	syslog if diag_output says so.
2887	* src/pies.c (log_to_stderr): Rename to log_to_stderr_only.
2888	All uses changed.
2889	(log_setup): Remove.
2890	(main): Use diag_setup to initialize diagnostics.
2891	* src/pies.h (log_to_stderr): Remove.
2892	(DIAG_TO_SYSLOG, DIAG_TO_STDERR): New defines.
2893	(diag_setup): New function.
2894
2895	Minor changes
2896
2897	* doc/Config (EXTRA_HEAD, AFTER_BODY_OPEN): Use qq{} to quote contents.
2898	* doc/fdl.texi: Upgrade to v.1.3.
2899	* doc/pies.texi: Likewise.
2900
2901	Pies dubbed a GNU package. Update all files accordingly.
2902
29032009-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>
2904
2905	Minor fix.
2906
2907	* doc/Config: Fix links in the main menu.
2908
2909	Version 1.1
2910
2911	* configure.ac, NEWS: Raise version number.
2912
2913	Fix diagnostics.
2914
2915	* po/POTFILES.in: Add missing files.
2916	* src/acl.c, src/meta1lex.l, src/pies.c,
2917	src/progman.c, src/socket.c,
2918	src/userprivs.c: Fix diagnostic messages.
2919
29202009-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2921
2922	Update.
2923
2924	* doc/Config, doc/gendocs_template: Update for the new
2925	layout.
2926
2927	Updates.
2928
2929	* src/meta1lex.l (%top): Include config.h to accomodate for the
2930	latest gnulib. This requires flex >= 2.5.30
2931	* grecs: Upgrade.
2932
2933	Account for possible system clock inaccuracies.
2934
2935	* src/pies.h (progman_wake_sleeping): Takes one argument.
2936	* src/progman.c (progman_wake_sleeping): Takes one argument.
2937	Account for possible clock inaccuracy.
2938	(progman_cleanup): Print correct signal number in the diagnostics.
2939	Update call to progman_wake_sleeping.
2940	* src/pies.c (main): Update call to progman_wake_sleeping.
2941
29422009-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2943
2944	Imrove the docs.
2945
2946	* doc/Config: New file. Configuration for texi2html.
2947	* doc/Makefile.am (manual): Update rule.
2948	(man-tar): New rule.
2949	* doc/gendocs_template: Rewrite using the new site
2950	layout.
2951	* doc/pies.texi: Minor changes.
2952
29532009-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2954
2955	Release 1.0.
2956
2957	* NEWS: Update.
2958	* bootstrap.conf: Call submodule init unconditionally.
2959	* doc/pies.texi: Minor changes.
2960
29612009-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2962
2963	Bugfixes.
2964
2965	* src/acl.c (acl_hasher): Fix signature.
2966	* src/progman.c (notify): Fix warnings.
2967
2968	Move to grecs master.
2969
2970	Improve diagnostics output.
2971
2972	* configure.ac (AC_CHECK_FUNCS): Remove checks for unused functions.
2973	* gnulib.modules: Add fprintftime. Remove quote.
2974	* src/pies.c (pidfile_read): Do not print error message if 'No such
2975	process' is returned.
2976	(main): Set default quoting style to shell.
2977	* src/pies.h: Include fprintftime.h.
2978	* src/progman.c (prog_start, progman_dump_stats): Quote arguments on
2979	output.
2980	(progman_dump_stats): Use fprintftime.
2981
2982	Move to grecs master.
2983
2984	Implement -D and -U options (preprocessor control).
2985
2986	* Makefile.am (dist-hook,alpha,alphacheck): New rules.
2987	(ChangeLog): Be silent.
2988	* NEWS: Update.
2989	* doc/pies.texi: Update.
2990	* gnulib.modules: Add quote and quotearg
2991	* src/pies.c: Implement -D and -U options. Improve --help
2992	output.
2993	* src/pies.h: Include quotearg.h
2994
2995	Various improvements.
2996
2997	* configure.ac (AC_CHECK_FUNCS): Check for vsyslog.
2998	* src/diag.c (syslog_printer) [!HAVE_VSYSLOG]: call syslog.
2999	* src/pies.c (component_keywords): Remove settle-timeout,
3000	replace it with pass-fd-timeout.
3001	(main): Force syslog logging if !foreground.
3002	Do not close first three fds before restarting
3003	if log_to_stderr is set.
3004	* src/pies.h (DEFAULT_PASS_FD_TIMEOUT): New constant.
3005	(struct component): Replace settle_timeout with
3006	pass_fd_timeout. All uses changed.
3007	(pass_fd): Pass timeout as argument.
3008	* src/progman.c (prog_start): Remove hardcoded sleep before
3009	calling pass_fd. Update call to pass_fd.
3010	(prog_start_prerequisites): Remove handling of settle_timeout.
3011	* src/socket.c (open_unix_socket): Remove.
3012	(pass_fd): Rewrite.
3013
3014	* doc/pies.texi: Update.
3015
30162009-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3017
3018	Proofread the docs.
3019
3020	* doc/pies.texi: Final cleanup.
3021	* doc/usr-acl.texi: Minor fix.
3022
3023	More fixes.
3024
3025	* doc/pies.texi: More fixes.
3026	* pp-setup: Remove MFD leftovers.
3027
3028	Various fixes.
3029
3030	* README: Fix typo.
3031	* doc/usr-acl.texi: New file.
3032	* doc/Makefile.am (pies_TEXINFOS): Remove pies.texi,
3033	add usr-acl.texi
3034	(check-config, check-sub-config): Handle @deffnx
3035	* doc/pies.texi: Update.
3036	* src/Makefile.am (AM_CPPFLAGS): Remove superfluous defs,
3037	use ../gnu/configmake.h instead
3038	* src/acl.c (_acl_common_section_parser): Handle tag, depending
3039	on the value of `flag' parameter.
3040	Avoid coredumping on NULL pacl.
3041	(acl_section_parser, defacl_section_parser): Update calls to
3042	_acl_common_section_parser.
3043	* src/pies.c (STATEDIR): Replace with LOCALSTATEDIR.
3044	(GRECS_VALUE_IS_EMPTY): New define (possibly belongs to
3045	grecs more than to pies).
3046	(assert_grecs_value_type)
3047	(return_code_section_parser): Use GRECS_VALUE_IS_EMPTY to check
3048	for empty value.
3049	(_get_array_arg): Bugfix.
3050	(component_keywords, pies_keywords): Add missing docstrings.
3051	* src/progman.c (TYPE_RETR): Rename to TYPE_REDIRECTOR.
3052	All uses updated.
3053
30542009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3055
3056	Minor changes.
3057
3058	* doc/Makefile.am (check-sub-config): Silent the rule.
3059	* doc/pies.texi: Update.
3060	* src/progman.c (default_termination_message): Use ${termination}
3061	(notify): Fix wording in ${termination}.
3062
3063	Fix ACL code.
3064
3065	* src/acl.c (pies_acl_create): Accept NULL name.
3066	(_parse_sockaddr): Fix calculation of netmask.
3067	(_acl_common_section_parser): New function.
3068	(acl_section_parser): Rewrite using _acl_common_section_parser.
3069	(defacl_section_parser): New function.
3070	(_check_sockaddr): Bugfix.
3071	(_acl_check): Break the loop when _check_sockaddr
3072	returns 1.
3073	(pies_acl_check): Break the loop when _acl_check_cb
3074	returns 1.
3075	* src/acl.h (defacl_section_parser): New prototype.
3076	* src/pies.c (component_keywords): New keyword
3077	defacl.
3078
30792009-10-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3080
3081	Bugfixes.
3082
3083	* README: Update.
3084	* configure.ac: Change bug-reporting address.
3085	* doc/pies.texi: Minor fixes.
3086	* src/pies.c: New configuration statements: mailer-program
3087	and mailer-command-line.
3088	(mailer_program, mailer_command_line)
3089	(mailer_argc, mailer_argv): New globals.
3090	* src/pies.h (mailer_program, mailer_command_line)
3091	(mailer_argc, mailer_argv): New globals.
3092	* src/progman.c (destroy_prog): Bugfix: update master
3093	program when destroying a retranslator.
3094	(send_msg): Several bugfixes. Use mailer_argc, mailer_argv
3095	instead of hardcoding sendmail command line. Remove
3096	invalid recipient addresses from the resulting command line.
3097
30982009-10-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3099
3100	Fix make distcheck and check-docs.
3101
3102	* doc/Makefile.am: Fix `check-*' goals.
3103	* doc/pies.texi: Update and rearrange material.
3104	Document new configuration.
3105	* lib/Makefile.am (libpies_a_SOURCES): Remove nls.c
3106	* src/Makefile.am (EXTRA_DIST): Remove pies.rc, add
3107	pp-setup.
3108	(INCLUDES): Add $(top_builddir)/gnu
3109	* src/pies.c: Minor changes.
3110	* src/progman.c: Minor changes.
3111	* README-hacking: New file.
3112
3113	Do not require Mailutils. Provide missing functions.
3114
3115	* Makefile.am (ACLOCAL_AMFLAGS): Add grecs/am
3116	* bootstrap.conf: Skip po.
3117	Initialize submodule.
3118	* configure.ac: Mailutils no longer needed.
3119	(AC_CONFIG_FILES): Add new subdirs.
3120	* gnulib.modules: Add more modules. Arrange entries
3121	alphabetically.
3122	* lib/Makefile.am: Rename library to libpies.
3123	* lib/libpies.h (mf_privs)
3124	(switch_to_privs, get_user_groups)
3125	(mf_priv_setup, mf_epriv_setup): Move to src/pies.h
3126	(config_array_to_argv, config_array_to_string)
3127	(config_cb_timeout): Remove.
3128	(tokendef): New struct.
3129	(strtotok_len, strtotok_len_ci)
3130	(strtotok, strtotok_ci, toktostr): New prototypes.
3131	* lib/nls.c: Remove call to mu_init_nls.
3132	* src/acl.c: New file.
3133	* src/addrfmt.c: New file.
3134	* src/diag.c: New file.
3135	* src/meta.c: New file.
3136	* src/url.c: New file.
3137	* src/userprivs.c: New file.
3138	* src/acl.h: New file.
3139	* src/pp-setup: New file.
3140	* src/Makefile.am (pies_SOURCES): Add acl.c,
3141	addrfmt.c, diag.c, meta.c, url.c, userprivs.c.
3142	(noinst_HEADERS): Add acl.h.
3143	(inc_DATA): Add pp-setup.
3144	* src/limits.c, src/meta1gram.y,
3145	src/meta1lex.h, src/meta1lex.l,
3146	src/pies.c, src/pies.h, src/progman.c,
3147	src/socket.c, src/userprivs.c: Remove calls to
3148	functions from Mailutils.
3149
31502009-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3151
3152	Branch off from the Mailfromd project into a separate repository.
3153
31542009-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3155
3156	Improve the upgrade conversion script. Update docs.
3157
3158	* NEWS: Update.
3159	* doc/Makefile.am (check-config, check-sub-config): New goals.
3160	(all-check-docs): Depend on the above.
3161	* doc/mailfromd.texi: Document syslog-async configuration
3162	statement.
3163	* doc/pragma-option.texi: Move the ignore block to doc/mailfromd.texi.
3164	* doc/upgrade.texi (5x0-600): Describe the changes and the
3165	proposed conversion procedure.
3166	* mfd/main.c (rename_legacy_file): new variable.
3167	(close_change_conf): Improve the created script.
3168	(cb_db_expire_interval): Bugfix.
3169	(database_section_param): File statement is mu_cfg_callback.
3170	(main): Set rename_legacy_file if necessary.
3171
3172	Define the `database' configuration statement. Document new configuration.
3173
3174	* doc/pragma-option.texi: New file.
3175	* doc/pragma-database.texi: New file.
3176	* doc/Makefile.am (mailfromd_TEXINFOS): Add new files.
3177	* doc/mailfromd.texi: Document configuration file.
3178	* doc/upgrade.texi (5x0-600): New section.
3179	* mfd/gram.y (pragma_database): Add calls to write_db_config.
3180	* mfd/main.c (write_db_config): New function.
3181	(close_change_conf): Handle 'G' records.
3182	(cb_relay_file): Remove duplicate function.
3183	(cb_db_expire_interval, cb_db_positive_expire_interval)
3184	(cb_db_negative_expire_interval): New functions.
3185	(database_section_param): New configuration file statement:
3186	"database".
3187	(database_cfg_init): New function.
3188	(main): Call database_cfg_init.
3189	* mfd/mailfromd.h (write_db_config): New prototype.
3190
31912009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3192
3193	Fix diagnostic and help messages.
3194
3195	1. Option descriptions in `--help' output do not constitute
3196	   conceptual sentences. Therefore, they should not begin
3197	   with a capital letter, nor end with a final point.
3198	2. According to standards.texi, a diagnostic message in a
3199	   non-interactive program "should not begin with a capital letter
3200	   when it follows a program name and/or file name, because that
3201	   isn't the beginning of a sentence.  (The sentence conceptually
3202	   starts at the beginning of the line.)  Also, it should not end
3203	   with a period."
3204
3205	Affected files:
3206
3207	* gacopyz/gacopyz.c
3208	* gacopyz/proc.c
3209	* gacopyz/server.c
3210	* gacopyz/smfi.c
3211	* mfd/bi_db.m4
3212	* mfd/bi_dns.m4
3213	* mfd/bi_io.m4
3214	* mfd/bi_ipaddr.m4
3215	* mfd/bi_mail.m4
3216	* mfd/bi_other.m4
3217	* mfd/bi_poll.m4
3218	* mfd/bi_sa.m4
3219	* mfd/bi_string.m4
3220	* mfd/cache.c
3221	* mfd/db.c
3222	* mfd/dnscache.c
3223	* mfd/drivers.c
3224	* mfd/engine.c
3225	* mfd/gram.y
3226	* mfd/lex.l
3227	* mfd/main.c
3228	* mfd/mu_dbm.c
3229	* mfd/optab.opc
3230	* mfd/prog.c
3231	* mfd/rate.c
3232	* mfd/symtab.c
3233	* mtasim/mtasim.c
3234	* mtasim/openat-die.c
3235	* pies/pies.c
3236	* pies/progman.c
3237	* pmult/pmult.c
3238	* smap/smap.c
3239	* tests/ashadow.at
3240	* tests/bctx00.at
3241	* tests/fctx00.at
3242	* tests/hdr-gete.at
3243	* tests/invcidr.at
3244	* tests/invcidr2.at
3245	* tests/shadow.at
3246
3247	Minor fixes.
3248
3249	* mfd/main.c (parse_opt): Add missing break.
3250	(cb_include_path): Fix use of improper variable
3251	in MU_CFG_LIST branch.
3252	* am/aggr.m4 (IU_CHECK_MEMBER): Remove improper use of dnl.
3253	* doc/Makefile.am (check-builtins, check-mflib): Do not
3254	split sed expressions over multiple lines: Makefile format
3255	cannot handle it properly.
3256	* doc/mailfromd.texi: Update.
3257	* bootstrap: Do not apply `silentize' to gnu/gnulib.mk. Latest
3258	gnulib takes care of it itself.
3259
32602009-08-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3261
3262	Implement getpw.* interfaces
3263
3264	* mfd/bi_getpw.m4: New file.
3265	* mfd/Makefile.am (M4_FILES): Add bi_getpw.m4
3266	* doc/Makefile.am (check-builtins): Take into
3267	account @deftypefnx
3268	* NEWS, doc/mailfromd.texi: Update
3269
32702009-06-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3271
3272	Bugfixes.
3273
3274	* pies/pies.c (main): Change main loop to do..while,
3275	otherwise a signal arriving before entering the loop
3276	might cause the program to terminate.
3277	* pmult/pmult.c (internal_macro_p): New function.
3278	(collect_stage_symbols): Do not report internal
3279	macros as untranslatable.
3280	* mfd/gram.y (register_macro): Copy macro name to
3281	allocated storage.
3282
32832009-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3284
3285	Fix and improve termination actions in pies.
3286
3287	* pies/pies.h (MAX_RETURN_CODE): Remove.
3288	(STATUS_SIG_BIT, STATUS_CODE): New defines
3289	(struct action): New fields next, nstat, status, command.
3290	(struct component): Keep singly-linked list of termination
3291	actions.
3292	* pies/progman.c (run_command): New function.
3293	(progman_cleanup): Redo iteration over termination actions.
3294	* pies/pies.c (return_code_cfg_param): Pass offsets in
3295	struct component.
3296	(create_action): Accept signal numbers (SIG.* or SIG\+[0-9]+)
3297	in tag.
3298	(return_code_section_parser): Update.
3299	(pies_check_status): Set *pid before returning pies_status_stale.
3300	* doc/pies.texi: Document changes.
3301	* NEWS: Updated.
3302
33032009-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3304
3305	MeTA1-related improvements.
3306
3307	* configure.ac: Check for pmilter_S.pmfi_thrmax_[sh]. Requires
3308	28/0009-pmilter-configurable-maxthr.diff.
3309	* pmult/pmult.c: New configuration statements: max-threads-soft
3310	and max-threads-hard.
3311	* pies/pies.c (_cm_include_meta1): Fix coredump on syntax errors
3312	in meta1.conf.
3313
33142009-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3315
3316	More work on `silent rules' mode
3317
3318	* bootstrap (silent_rules_prog): Preserve leading
3319	whitespace verbatim, when inserting the AM_V variables.
3320	Suggested by Ralf Wildenhues.
3321	Optionally insert the definitions of
3322	AM_DEFAULT_VERBOSITY, AM_V_GEN and AM_V_at: useful for
3323	po/Makefile.in.in
3324	(silentize): New function.
3325	(slurp): Call silentize
3326	Call silentize on po/Makefile.in.in.
3327	* doc/Makefile.am, etc/Makefile.am,
3328	pies/Makefile.am, pmult/Makefile.am,
3329	tests/Makefile.am, tests/etc/Makefile.am: Add silent rule markers.
3330
3331	Switch to `silent rules' mode
3332
3333	* bootstrap (slurp): Convert gnulib Makefile.am to
3334	support silent rules.
3335	* configure.ac (AM_INIT_AUTOMAKE): Add silent-rules.
3336	Enable silent rules by default.
3337	* gacopyz/Makefile.am, mfd/Makefile.am: Add silent rules markers.
3338
33392009-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3340
3341	Minor change
3342
3343	* mfd/bi_db.m4: Fix comment.
3344	* pies/progman.c: Use _exit in child processes.  This
3345	is a work over a fault in MU design: it registers
3346	the pidfile removal function via atexit.
3347
33482009-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3349
3350	Fix the docs
3351
33522009-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
3353
3354	Minor changes.
3355
3356	* NEWS: Update.
3357	* doc/mailfromd.texi: Reorder material.
3358	* doc/upgrade.texi: New file.
3359	* doc/fdl.texi, doc/gacopyz.texi, doc/strftime.texi: Move
3360	sectioning commands to the main source.
3361	* etc/mailfromd.rc: Reflect recent changes.
3362	* mfd/lex.l: Change semantics of __statedir__
3363	and __preproc__. Introduce __defstatedir__ and
3364	__defpreproc__.
3365
33662009-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3367
3368	Finish migration to Git.
3369
3370	* Makefile.am (dist-hook): Create ChangeLog.
3371	(ChangeLog): New rule.
3372	* NEWS, README-alpha, README-hacking: Update
3373	* gnulib.modules: Add gitlog-to-changelog
3374	* ChangeLog: Rename to ChangeLog.svn
3375
3376	* tests/hasmx.at, tests/hostname.at, tests/ismx.at,
3377	tests/poll.at, tests/poll01.at, tests/poll02.at,
3378	tests/poll03.at, tests/rescname.at, tests/resolve.at,
3379	tests/testsuite.at: Skip tests if the network is down.
3380
3381	Add .gitignores
3382
33832008-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3384
3385	Version 5.0
3386
3387	* configure.ac, NEWS: Version 5.0.
3388	* doc/mailfromd.texi, doc/pies.texi, doc/pmult.texi: Update.
3389	* doc/Makefile.am (check-builtins): Account for
3390	MF_DEFUN_VARARGS_NO_PROM.
3391
33922008-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
3393
3394	Update
3395
3396	Update
3397
3398	Documentation and minor fixes.
3399
3400	* pies/pies.c, pies/progman.c, pies/meta1gram.y, pies/pies.h,
3401	pies/meta1lex.l: Normalize output redirection terminology, fix the
3402	debug levels.
3403	* pmult/pmult.c: Fix error message
3404	* doc/pies.texi: Document the configuration.
3405
34062008-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>
3407
3408	Bugfixes/improvements.
3409
3410	* doc/mailfromd.texi: Document replbody. Use @WRITEME where appropriate.
3411	* doc/rendition.texi (WRITEME): New macro.
3412	(UNREVISED): Reword.
3413	* doc/pies.texi, doc/smap.texi: Use @WRITEME
3414	* doc/Makefile.am (check-writeme): New rule.
3415	(all-check-docs): Depend on check-writeme.
3416	* mfd/bi_body.m4 (replbody): Can be used in any handler.
3417	* NEWS: Rearrange material.
3418
34192008-11-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3420
3421	Pies: ensure all prereqs are started in right order before starting a dependency.
3422
3423	* pies/pies.c (component_cfg_param): New statement settle-timeout.
3424	* pies/progman.c (recompute_alarm): New static;
3425	(prog_start): Start the component only if all of its prerequisites
3426	are running.
3427	(progman_recompute_alarm): New function.
3428	(progman_start): Reset recompute_alarm to 0.
3429	(check_stopping): New function.
3430	(progman_wake_sleeping): Handle also status_stopping and
3431	status_enabled. Recompute alarm before leaving.
3432	(prog_start_prerequisites): Return 0 or 1 depending on whether all
3433	prerequisites have been started.
3434	(prog_stop): Raise recompute_alarm for stopping components.
3435	(progman_cleanup): Force status_enabled before attepmting to
3436	start a component.
3437	(progman_cleanup): Add a \n after debugging message.
3438	Run progman_wake_sleeping unlsess expect_term is set.
3439	* pies/meta1gram.y (translate_node_list): Force settle-timeout =
3440	1.
3441	* pies/pies.h (struct component.settle_timeout): New member.
3442
3443	Improve pies.
3444
3445	* pies/pies.c (main): New options --force, --dump-prereq and
3446	--dump-depmap.
3447	Refuse to start if another instance is already running.
3448	(pies_check_status): New function.
3449	(pies_status): Rewrite using pies_check_status.
3450	* pies/progman.c (component_fixup_depend): Bugfix: move
3451	mu_list_append off the conditional.
3452	(progman_dump_prereq, progman_dump_depmap): New functions.
3453	* pies/meta1gram.y (yyerror): Return 0.
3454	* pies/pies.h (progman_dump_prereq, progman_dump_depmap): New
3455	protos.
3456	(meta1_parser_set_debug, meta1lex, meta1error)
3457	(meta1parse): Likewise.
3458
3459	Improve pies.
3460
3461	* pies/progman.c (print_dep): New function.
3462	(progman_build_depmap): Call print_dep to facilitate fixing cyclic
3463	dependencies.
3464	(prog_start_prerequisites): Fix debugging output.
3465	Remove spurious second loop (was it a typo or copy-paste
3466	leftover?)
3467	(prog_stop_dependents): Fix debugging output.
3468	(progman_dump_stats): Avoid race conditions between running and
3469	querying instances.
3470
34712008-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3472
3473	Add pies.texi and smap.texi
3474
3475	Document and improve pmult.
3476
3477	* pmult/pmult.c (debug_level): Remove.
3478	(struct pmult_priv_data): Remove debug. Use pmult_debug instead.
3479	(macro_trans): Define Sendmail compatibility macros cn_issuer and
3480	cn_subject.
3481	(builtin_macros): Fix typo in "multiplexer".
3482	(define_macros): Rewrite.  The "define-macros" statement takes
3483	exactly two arguments, each of which can be either a string or a
3484	list of strings.
3485	* doc/values.texi, doc/mailfromd.texi, doc/pmult.texi: Update.
3486
3487	* doc/Makefile.am (check-fixmes): Scan all texinfo documents.
3488
3489	Fix handling of retranslators.
3490
3491	* pies/pies.c (main): Call progman_build_depmap and
3492	progman_create_sockets before starting up components.
3493	* pies/progman.c (struct prog): New member `retr'.
3494	(destroy_prog): New function.
3495	(retr_tag): Change signature. Fix erroneous condition for
3496	xalloc_die.
3497	(register_retr): Return prog. Make static. Initialize idx
3498	with -1.
3499	(update_retr): Register retranslator, if necessary.
3500	(progman_register_retranslators): Remove.
3501	(register_prog0): 2nd argument: index.
3502	(register_prog): Do not create socket at once.
3503	(prog_start): Remove debugging fprintf.
3504	(progman_accept): Update call to register_prog0.
3505	(progman_create_sockets): New function.
3506	(progman_start): Remove calls to progman_register_retranslators
3507	and progman_build_depmap. They must be done only once.
3508	(prog_stop_retranslators): New function.
3509	(prog_stop_dependents): Call prog_stop_retranslators.
3510	(progman_cleanup): Remove dangling retranslators.
3511	* pies/pies.h (progman_create_sockets): New prototype.
3512
35132008-11-16  Sergey Poznyakoff  <gray@gnu.org.ua>
3514
3515	Improve pies.
3516
3517	* pies/pies.h (create_socket): Change proto to 3 arguments.
3518	* pies/socket.c (create_socket): Take two additional arguments.
3519	Allow to configure ownership and mode of created UNIX sockets.
3520	* pies/progman.c (register_prog, prog_start): Update calls to
3521	create_socket.
3522
3523	Implement ctype functions.
3524
3525	* mfd/bi_ctype.m4: New function.
3526	* mfd/Makefile.am (inc_DATA): Add bi_ctype.m4.
3527	* doc/Makefile.am (check-builtins): Update source sed expression.
3528	* doc/mailfromd.texi, NEWS: Document ctype functions.
3529
35302008-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3531
3532	Improve handling of program privileges.
3533
3534	* lib/libmf.h (struct mf_privs): New data type.
3535	(get_user_groups, mf_priv_setup, mf_epriv_setup): New prototypes.
3536	* lib/userprivs.c (get_user_groups, mf_priv_setup)
3537	(mf_epriv_setup): New functions.
3538
3539	* smap/smap.c: If user is specified, switch to effective uid/gid,
3540	in order for msrv to create files with right privileges, on one
3541	hand, and to be able to create pidfile in root-owned directories
3542	(e.g. /var/run), on the other hand. This requires todays snapshot
3543	of Mailutils.
3544
3545	* pies/pies.h (struct pies_privs_data): Remove
3546	(struct component): Change type of `privs' to struct mf_privs.
3547	(priv_setup): Remove.
3548	* pies/pies.c: Use mf_priv* stuff to manipulate privileges.
3549	* pies/progman.c: Likewise.
3550	* pies/meta1gram.y (list): allow for trailing comma.
3551
35522008-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3553
3554	Bugfix.
3555
3556	* pies/Makefile.am (LDADD): Add MF_PROCTITLE_LIBS
3557
3558	Bugfix.
3559
3560	* lib/proctitle.c (mf_proctitle_format):
3561	* pies/progman.c (progman_register_retranslators): Register
3562	retranslators only for retr_syslog.
3563	(open_retranslator): Do not prepend program name to the proctitle.
3564	It is done automatically by the library.
3565	* lib/proctitle.c: Declare environ.
3566	Define __progname if not defined in libc.
3567	(mf_proctitle_init): Set __progname.
3568	(mf_proctitle_format): Prepend program name to the proctitle.
3569
3570	Implement file output redirection.
3571
3572	* pies/pies.h (enum retr_type): New constants.
3573	(struct retranslator): New type.
3574	(struct component): Change type of retr to struct retranslator.
3575	All uses updated.
3576	* pies/pies.c (_cb_retr): Takes two arguments:
3577	redirection type and file name or syslog priority.
3578	(make_full_name): New function.
3579	(component_verify): Check retr file names.
3580	* pies/progman.c (redirect_to_file): New function.
3581	(open_retranslator): Handle file redirects.
3582	(prog_start): Open /dev/null in wronly mode.
3583	* pies/meta1gram.y (create_retr_node): New function.
3584	(translate_node_list): Create default "stderr" statement.
3585
3586	Implement setproctitle functionality for pies.
3587
3588	* am: New directory.
3589	* am/aggr.m4, am/debug.m4: New files (from acinclude.m4)
3590	* am/proctitle.m4: New file.
3591	* acinclude.m4: Removed.
3592	* configure.ac: Call MF_PROCTITLE.
3593	* lib/libmf.h (mf_proctitle_format): New prototype.
3594	* lib/proctitle.c: New file.
3595	* lib/Makefile.am (libmf_a_SOURCES): Add proctitle.c.
3596	* Makefile.am (ACLOCAL_AMFLAGS): Add -I am
3597
3598	* pies/pies.c (main): Call mf_proctitle_init.
3599	* pies/progman.c (retr_tag): Rewrite in a safer way.
3600	(open_retranslator): Set program title in child.
3601
3602	Allow to complement existing components (useful for MeTA1 includes).
3603
3604	* pies/pies.c (component_verify): New function.
3605	(component_section_parser): Call component_verify.
3606	(_cm_include_meta1): Reduce the tree at once.
3607	(parse_meta1_conf): Not needed any more.
3608	* pies/progman.c (progman_register_retranslators): New function.
3609	(pies/progman.c): Do not register retranslators: wait until the
3610	entire config is parsed and do that in progman_start.
3611	(progman_start): Call progman_register_retranslators.
3612
3613	Optonal semicolon after a simple statement
3614
36152008-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3616
3617	Implement dependencies/prerequisites in MeTA1.
3618
3619	* pies/pies.c (component_cfg_param): Rename "depend" to
3620	"prerequisites". Add new keyword "dependents".
3621	(pies_cfg_param): New keyword "limits".
3622	* pies/progman.c (struct prog): Rename "depend" to "prereq".
3623	(prog_start_dependencies): Rename to prog_start_prerequisites
3624	(register_prog0): Do not fill prereq. This will be done later,
3625	when all dependencies are resolved.
3626	(prog_rebuild_prerequisites): New function.
3627	(prog_start): Per-component limitis override system-wide ones.
3628	(component_fixup_depend, fixup_prerequisites)
3629	(rebuild_prerequisites): New functions.
3630	(progman_build_depmap): Call fixup_prerequisites and
3631	rebuild_prerequisites.
3632	(prog_stop_dependent): Rename to prog_stop_dependents.
3633	* pies/meta1gram.y: Implement restart_dependencies.
3634	* pies/pies.h (struct component): Rename "depend" to "prereq". Add
3635	new member "depend".
3636	(pies_limits): New extern.
3637
3638	* pies/pies.rcin: Update
3639
3640	Implement MeTA1 configuration file parser.
3641
3642	* configure.ac: Require Mailutils 1.9.93
3643	* doc/mailfromd.texi, NEWS: Update.
3644	* pies/pies.c (_cb_depend): Accept list argument.
3645	(component_cfg_param): New statement: program.
3646	(pies_cfg_param): New statements: include-meta1 and
3647	meta1-queue-dir.
3648	(parse_meta1_conf, pies_cfg_verifier): New functions.
3649	(main): Set mu_app_cfg_verifier. Call parse_meta1_conf.
3650	* pies/progman.c (progman_lookup_component): New function.
3651	(prog_start): Pass program name (eventually differing from
3652	argv[0]).
3653	* pies/pies.h (struct component): New member `program'.
3654	(progman_lookup_component): New prototype.
3655	* pies/meta1gram.y, pies/meta1lex.h, pies/meta1lex.l: New files.
3656	* pies/Makefile.am (pies_SOURCES): Add meta1gram.y and
3657	pies/meta1lex.h.
3658	(noinst_HEADERS, AM_YFLAGS, AM_LFLAGS): New variables.
3659
36602008-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3661
3662	Bugfixes
3663
3664	* pies/pies.c (component_cfg_param, pies_cfg_param): New keyword:
3665	allgroups.
3666	(pies_add_allgroups): New function.
3667	* pies/limits.c: Fix debug statements.
3668	* pies/progman.c (build_depmap): Rename to
3669	progman_build_depmap. Make extern, for future use. All callers
3670	updated.
3671	* pies/pies.h (progman_build_depmap): New proto.
3672
3673	pies: rename open_socket to create_socket
3674
3675	Bugfixes
3676
3677	* pies/pies.c: Fix ACTION_COMPRELOAD
3678	* pies/progman.c (open_retranslator): (child) close all open
3679	sockets, except p[0] (pipe input).
3680	(prog_start): Bugfix: mark sleeping components with
3681	status_sleeping.
3682	(prog_start): stdout retranslation works for pies_comp_pass_fd.
3683	Mark started processes with status_enabled.
3684	(progman_start): Start enabled processes if pid is 0.
3685	(progman_stop_component): Correctly handle various status types.
3686	(progman_dump_stats): Mark processes being stopped.
3687
3688	Bugfixes
3689
3690	* pies/pies.c (component_cfg_param): Bugfix.
3691	(component_section_parser): Initialize comp->pass_fd_socket
3692	* pies/progman.c (prog_start): Listen on the socket, if in pass_fd
3693	mode. Avoid closing it.
3694	(prog_stop_all): Kill programs being stopped.
3695	* pies/socket.c (pass_fd): Check return from open_unix_socket.
3696
36972008-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3698
3699	Rewrite pies to incorporate into it the functionality of inetd and mcp.
3700
3701	* pies/pies.c (pmult_debug): Rename to pies_debug.
3702	(pies_acl): New global.
3703	(component_cfg_param): New statements: mode, socket,
3704	pass-fd-socket, acl, limits.
3705	(component_section_parser): Allocate comp. Check its consistency
3706	on mu_cfg_section_end.
3707	(pies_cfg_param): New statement: acl.
3708	(main): Call mu_acl_cfg_init. Use pies_pause instead of pause.
3709	* pies/limits.c: New file.
3710	* pies/progman.c (enum prog_status): New status: status_listener.
3711	(struct prog): Keep a pointer to the original struct component,
3712	instead of copying its fields (except for depend, which is copied
3713	anyway). All uses updated.
3714	(prog_lookup_by_socket, unlink_prog, register_prog0): New
3715	functions.
3716	(prog_start, progman_cleanup, progman_stop_component): Rewrite to
3717	take into account various component modes.
3718	(pies_check_acl): New function.
3719	(progman_accept): New function.
3720	* pies/pies.h (limits_record_t): New typedef.
3721	(enum pies_comp_mode): New constants.
3722	(struct component): New members: mode, limits, socket_url,
3723	pass_fd_socket, acl.
3724	(progman_accept): New proto.
3725	(pies_pause, register_listener, pass_fd, open_socket)
3726	(parse_limits, set_limits): New protos.
3727	* pies/Makefile.am (pies_SOURCES): Add limits.c and socket.c
3728	* pies/socket.c: New file.
3729
3730	* configure.ac: Check for msg_control and msg_accrights in struct
3731	msghdr.
3732	* acinclude.m4 (IU_CHECK_MEMBER, IU_CHECK_MEMBERS): New macros
3733	(from inetutils).
3734
3735	Minor fixes.
3736
3737	* pies/progman.c (prog_start): Bugfix.
3738	* pmult/pmult.c (pmult_cfg_param): New configuration statement
3739	pmilter-debug.
3740	(main): Call sm_pmfi_setdbg.
3741
37422008-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3743
3744	Improvements.
3745
3746	* mflib/verp.mf (verp_extract_user): Pass email as the first
3747	argument.
3748	* doc/mailfromd.texi: Update.
3749	* doc/Makefile.am: Add pmult.texi
3750	* doc/pmult.texi: New file.
3751	* mfd/lex.l: %% and $$ in quoted strings are replaced by single %
3752	and $, correspondingly.
3753	* NEWS: Update.
3754
37552008-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3756
3757	Allow to configure which macros to pass to the filter.
3758
3759	* gnulib.modules: Add inttostr
3760	* smap/smap.c, pies/progman.c, pies/pies.h: Use umaxtostr, instead
3761	of mu_umaxtostr.
3762
3763	* pmult/pmult.c (struct pmult_priv_data): New members: argc,
3764	argv.
3765	(macro_trans, meta_stage_trans, macrotab, macronames): New
3766	globals.
3767	(translate_macros0, translate_macros): New functions.
3768	(define_macros, define_macros_iter): New functions.
3769	(_cb_define, request_auth_macros): New functions.
3770	(pmult_cfg_param): New keyword `define-macro'.
3771	(pmult_free): Free argv.
3772	(pmult_negotiate): Use sm_pmfi_setmacs, if available.
3773	(pmult_connect, pmult_helo, pmult_mail, pmult_rcpt)
3774	(pmult_data, process_headers, pmult_eom): Use translate_macros.
3775	(main): Handle want_auth_macros.
3776
3777	* configure.ac: Check for sm_pmfi_setmacs. This function should
3778	appear in meta1-1.0.PreAlpha28.0.
3779
37802008-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3781
3782	* pies/progman.c (env_setup): Port new implementation from Rush.
3783
3784	* gnulib.modules: Add c-ctype
3785	* mtasim/mtasim.c, pies/pies.h, pmult/pmult.c, lib/parsetime.c,
3786	mfd/lex.l, mfd/gram.y, mfd/mailfromd.h, mfd/spf.c,
3787	mfd/bi_sprintf.m4, mfd/bi_io.m4, mfd/pp.c, mfd/main.c: Use c-ctype,
3788	instead of ctype.
3789
37902008-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3791
3792	Introduce "precious" components.
3793
3794	* pies/pies.c (component_cfg_param): New configuration statement
3795	`precious'.
3796	* pies/progman.c (struct prog): New member `precious'.
3797	(register_prog): Set precious.
3798	(prog_start_dependencies): Do not mark disabled precious
3799	dependencies of a disabled component.
3800	* pies/pies.h (pies/pies.h): New member `precious'.
3801	* pies/pies.rcin (mcp): Mark as precious.
3802
3803	Bugfix.
3804
3805	* pies/pies.c (return_code_section_parser): Fix to work with tag
3806	of any type.
3807	* pies/pies.rcin: Minor change.
3808
3809	Terminate components in reverse order.
3810
3811	* pies/pies.c (main): Do cleanup after main action processing and
3812	only if action == ACTION_CONT.
3813	* pies/progman.c (struct prog): New member `prev'.
3814	(link_prog): Maintain doubly-linked list.
3815	(prog_stop_dependent): Avoid printing diagnostics if there are
3816	no dependencies to be stopped.
3817	(prog_stop): Do nothing if prog->pid is zero.
3818	Do not call prog_stop_dependent, it will be done by
3819	progman_cleanup.
3820	(prog_stop_all): Terminate components from last to first.
3821	* pies/pies.rcin: Improve example, by adding mcp component.
3822
3823	Improvements in pies.
3824
3825	* pies/pies.c (_cb_depend): Handle single string value.
3826	(_cb_retr): Fix diagnostic message.
3827	(_cb_facility): New function.
3828	(component_cfg_param): New statement `facility'.
3829	(component_section_parser): Initialize comp.facility to the
3830	default value.
3831	* pies/progman.c (struct prog): New member `facility'.
3832	(register_prog): Initialize facility.
3833	(open_retranslator): Use master->facility.
3834	* pies/pies.h (struct component): New member `facility'.
3835
38362008-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3837
3838	Bugfix.
3839
3840	* pies/progman.c (register_prog): Remove stray semicolon.
3841	(retr_exit): Use _exit.
3842	(prog_stop_dependent): Bugfix: stop retranlators as well as
3843	components.
3844
38452008-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
3846
3847	Remove unused vars
3848
3849	Fix MU configuration file support.
3850
3851	* lib/libmf.h (config_array_to_argv)
3852	(config_array_to_string, config_cb_timeout): new prototypes.
3853	* lib/utils.c: New
3854	* lib/Makefile.am (libmf_a_SOURCES): Add utils.c
3855	* mfd/gram.y (defer_initialize_variable): Both args are const.
3856	* mfd/mailfromd.h (defer_initialize_variable)
3857	(add_include_dir): Change signatures.
3858	* mfd/pp.c (add_include_dir): Arg is const.
3859	* pies/pies.c, pmult/pmult.c, mfd/main.c: Rewrite configuration
3860	file support to match changes in Mailutils.
3861
38622008-09-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3863
3864	Version 4.9.93
3865
3866	* configure.ac: Version 4.9.93
3867	* NEWS: Likewise.
3868	* pies/pies.c: Change description.
3869
38702008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3871
3872	* pies/pies.h: Include stdint.h * configure.ac: Fix checking for libresolv.
3873
38742008-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3875
3876	* doc/Makefile.am (check-refs, check-fixmes): Print correct locations for multiple input files. Return a meaningful error code. * TODO: Update.
3877
3878	Rewrite the bootstrap suite.
3879
3880	* README-alpha: Rewritten.
3881	* bootstrap.conf: Rewritten.
3882	* bootstrap: Slightly modified version from gnulib.
3883	* gnulib.modules, README-hacking: New files.
3884	* doc/mailfromd.texi: Minor fix.
3885
38862008-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3887
3888	Port r1632 of branches/release_4_3_patches.
3889
38902008-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3891
3892	Use ngettext
3893
38942008-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3895
3896	Minor fixes in translatable strings
3897
38982008-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3899
3900	* 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.
3901
3902
3903Local Variables:
3904mode: change-log
3905version-control: never
3906buffer-read-only: t
3907End:
3908