Age | Commit message (Collapse) | Author | Files |
|
* NEWS: Document the "env" statement and the PIES_MASTER_PID
environment variable.
Version 1.3.91
* configure.ac: Version 1.3.91
* doc/pies.texi: Document the new "env" statement syntax. Provide
instructions on how to convert legacy "env" statement to the new
form.
* lib/envop.c (environ_unset): Take reference value as argument.
If supplied, unset the variable only if its value matches the
reference one.
* lib/envop.h (environ_unset): Change proto.
* src/pies.c (parse_legacy_env): Minor changes.
(_cb_env_unset): Allow to specify value.
* src/progman.c (run_command): Define PIES_MASTER_PID.
* tests/env.at: Check the legacy env syntax.
* tests/envop.at: Additional checks.
|
|
Presence of the ~/.netrc file can slow down execution because of eventual
DNS calls in hostcmp. Provide an option to disable netrc parsing and use
it in tests.
* src/piesctl-cl.opt: New option: --no-netrc.
* doc/pies.texi: Document --no-netrc
* src/piesctl.c (shttp_connect): Don't read ~/.netrc if given --no-netrc.
* tests/env.at: Pass --no-netrc to piesctl.
* tests/respawn.at: Likewise.
* tests/shell.at: Likewise.
* tests/shutdown.at: Likewise.
* tests/startup.at: Likewise.
|
|
The aim is to run pies in foreground if possible. Limit execution time
using external wrapper.
* src/pies.c: (_cb_redir): Consistently return 1 on errors.
* tests/aux/sleepexit: New file.
* tests/aux/startcheck: New file.
* tests/aux/touchfile: Change arguments.
* tests/aux/respawn: Rewrite.
* tests/lines.c: New noinst program.
* tests/to.c: New noinst program.
* tests/.gitignore: Add new programs.
* tests/Makefile.am: Update.
* tests/env.at: Use to to avoid hanging forever.
Add missing popdef.
* tests/redirect.at: Use echo as component program.
* tests/respawn.at: Run pies in foreground. Use to to limit execution
time.
* tests/shell.at: Likewise.
* tests/shutdown.at: Likewise.
* tests/startup.at: Likewise.
* tests/ret-exec.at: Use sleepexit as component program.
* tests/ret-notify.at: Likewise.
|
|
The "env" statement is now a compound statement. It can contain four
substatements: "clear" to clear the environment, "keep" to retain
certain variable while clearing it, "set" to set a variable, and
"unset" to unset a variable or variables.
Both "keep" and "unset" can take globbing pattern as their argument,
in which case they affect all variable matching that pattern.
The value part in the "set" statement is subject to variable expansion,
e.g.
set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man"
The support for the old one-line syntax of "env" is retained for
backward compatibility.
This commit also fixes redirection to a file: new data are appended
to the file, instead of overwriting it.
* lib/Makefile.am: Add new files.
* lib/envop.c: New file.
* lib/envop.h: New file.
* lib/wildmatch.c: New file.
* src/comp.c (component_free): Update.
* src/pies.c (argv_free): New function.
(parse_legacy_env): New function.
(_cb_env): Remove.
(cb_env_section_parser): New function.
(cb_env_keywords): New keywords for the "env" block statement:
clear, keep, set, unset.
(component_keywords): New compount statement: env.
Old usage retained for backward compatibility.
* src/pies.h: Include "envop.h"
(component)<env>: Remove.
<envop>: New field.
* src/prog.h (prog)<env>: New field.
* src/progman.c (redirect_to_file): Position to the end of file.
(DEBUG_ENVIRON): Remove macro.
(debug_environ): New function.
(environ_setup): Remove.
(prog_sockenv): Use environ_set to modify local copy of environment.
(prog_start_prologue): Use environ_create + envop_exec to create and
modify the environment.
(prog_execute): Set environment to prog-local copy.
* tests/.gitignore: Build envtest
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add environment tests.
* tests/envop.at: New file.
* tests/envtest.c: New file.
* tests/env.at: New file.
* tests/redirect.at: Check first two lines of the output file.
|
|
The new flag "shell" instructs pies to run the command marked with it
as '/bin/sh -c $command'. Alternative shell can be supplied ising the
'program' statement.
This is useful if the command line uses shell-specific features (command
or variable expansion, redirection, pipes, etc.)
This commit also fixes a bug in the 'env' statement handling: a single
argument with embedded whitespaces was undergoing word splitting and
thus incorrectly handled as multiple arguments.
* NEWS: Document changes.
* doc/pies.texi: Likewise.
* src/comp.c (component_free): Free command.
(component_finish): Split command into argv/argc as directed by the
CF_SHELL flag.
* src/pies.c (_cb_command): Remove. Functionality moved to
component_finish().
(_cb_env): Bugfix. Don't split arguments.
* src/pies.h (CF_SHELL): New flag.
(component) <command>: New member.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
* tests/aux/respawn: Change default timeout to 1 second.
* tests/respawn.at: Minor change.
* tests/shell.at: New test.
|
|
* src/progman.c (register_prog0): Preserve comp->redir[RETR_OUT].type
for exec, startup, and shutdown components.
|
|
* src/pies.h: Update comment.
* src/progman.c (register_prog0): Register shutdown components
in disabled state.
(program_shutdown): New function.
(progman_stop): Call program_shutdown.
* tests/shutdown.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
* tests/aux/startup: Rename to tests/aux/touchfile
* tests/startup.at: Reflect the change.
|
|
* src/ctl.c (pies_comp_mode_str): Add pies_comp_startup
and pies_comp_shutdown.
* src/piesctl.c (mode_trans): Likewise.
* src/progman.c (progman_startup_phase): Test the status of
pies_comp_startup components.
(progman_waiting_p): Test status instead of pid>0 to select running
components.
(progman_cleanup): Set status of the finished startup
component to status_finished, instead of removing it.
* src/comp.c (loaded): Remove unused variable.
(component_config_commit): Remove special handling for pies_comp_startup.
|
|
These are components that are run at program startup. Starting
other components is delayed until all startup components terminate.
This is similar to SysV "bootwait" components.
Upon termination, startup components are removed from the configuration.
They are not renewed upon configuratuion reload.
* src/comp.c (comp_array_remove): Remove from the depmap as well.
(component_ref_decr): Use comp_array_remove for active components
and plain component_free for inactive ones.
(component_build_depmap): Use comp_array_remove.
(component_config_commit): Special handling for pies_comp_startup
components.
* src/pies.c (modetab): New component modes: "startup" and "shutdown".
(main): Run program_init_startup.
* src/pies.h (pies_comp_mode): New modes: pies_comp_startup and
pies_comp_shutdown.
(program_init_startup): New proto.
* src/progman.c (progman_waiting_p): Return 1 if a startup component
is still running.
(program_init_startup): New function.
(progman_cleanup): Handle pies_comp_startup termination.
* src/socket.c (switch_eids): Avoid unnecessary calls to setegid
and seteuid.
* tests/atlocal.in (auxdir): New variable.
* tests/mailer: Move to tests/aux/
* tests/respawn: Move to tests/aux/
* tests/retcode: Move to tests/aux/
* tests/aux/startup: New auxiliary program.
* tests/redirect.at: Start components from $auxdir.
* tests/respawn.at: Likewise.
* tests/ret-exec.at: Likewise.
* tests/ret-notify.at: Likewise.
* tests/startup.at: New file.
* tests/testsuite.at: Include startup.at
* tests/Makefile.am: Add new tests.
|
|
|
|
* src/comp.c (component_log_dep): Remove.
(report_cyclic_dependency): New function.
(comp_array_remove): New function.
(component_build_depmap): Remove erroneous components both from
the component table and dependency map.
(components_dump_depmap): Avoid trailing whitespace in the output.
* src/depmap.c (depmap_clear_all): Remove.
(depmap_remove): New function.
* src/pies.h (CF_REMOVE): New flag.
(depmap_clear_all): Remove prototype.
(depmap_remove): New prototype.
* tests/Makefile.am: Add new test.
* tests/atlocal.in (trimws): New function.
* tests/cyclic.at: New test.
* tests/testsuite.at: Include new test.
|
|
|
|
This is useful if pies is run as a entrypoint process in a
docker container.
|
|
Coredump was triggered by detected cyclic dependency.
|
|
* src/Makefile.am (install-data-hook): Add missing DESTDIR
(Reported by Rafael Fontenelle).
|
|
Spotted by Rafael Fontenelle.
|
|
* src/pies.c (setsigvhan): Fix setting signals
|
|
|
|
Port fixes from GNU rush
|
|
|
|
* grecs: Upgrade.
* src/pies.h: Fix include paths.
* src/piesctl.c: Likewise.
* NEWS: Document changes.
* doc/pies.texi: Likewise.
|
|
|
|
|
|
* src/pies.c (main): Issue the start-up message after eventual changing
to background and the corresponding reconfiguration of diagnostic output
channel.
* src/piesctl.c (parse_condition_to_uri, com_id): Fix checking for arguments.
|
|
* configure.ac: Check for libnsl
* src/pies.c (string_to_syslog_facility): LOG_AUTHPRIV and LOG_FTP
may be undefined.
* src/piesctl.c (EX_NOTFOUND): Rename to EX_PIES_NOTFOUND.
(com_list): Use default_cond.
* src/sysvinit.c (console_stty): Make sure CBAUDEX is defined.
* src/utmp.c (fill_utmp): Declare locals right before using them.
|
|
* doc/pies.texi: Document piesctl and identity providers.
* src/piesctl.c: Fix reference to the docs.
|
|
* src/pies.c (main): Fix syntax type comparison.
|
|
pies -T is now fully compatible with the legacy telinit command
* src/telinit.opt: New file.
* src/Makefile.am: Add telinit.opt
* src/cmdline.opt (-T): Remove explicit variable. Rest of
command line is processed specially.
* src/pies.h (telinit): Change prototype.
* src/sysvinit.c (telinit): Rewrite.
* src/.gitignore: Update.
* doc/pies.texi: Document telinit.
|
|
All ACL keywords can be used in simple statement as well as in block form.
As simple statements, they take a name of an already defined named ACL. E.g.:
defacl forbid {
deny any;
}
component foo {
list-acl forbid;
}
This commit also fixes some eventual double-frees.
* doc/pies.texi: Update.
* src/acl.c (pies_acl)<refcnt>: New member.
(pies_acl_use): New function.
(pies_acl_create): Initialize refcnt.
(pies_acl_destroy): New function.
(pies_acl_free): Rewrite as a wrapper over pies_acl_destroy.
(_parse_sub_acl): Call pies_acl_use when installing a named ACL.
(_acl_common_section_parser): Handle grecs_callback_set_value.
* src/acl.h (pies_acl_destroy)
(pies_acl_use): New function.
* src/comp.c (component_free): Free acl.
|
|
|
|
* src/comp.c (component_verify): Fix stdout redirection check.
* src/meta1parse.c (meta1_translate_node): Skip simple statements.
(meta1_translate_node): Allocate comp->dir
* doc/pies.texi: Use @example instead of @smallexample
|
|
* configure.ac (EMERGENCY_SHELL): New arg_var.
* src/Makefile.am (AM_CPPFLAGS): Define EMERGENCY_SHELL.
* src/sysvinit.c (emergency_shell): Initialize with the
value of EMERGENCY_SHELL.
|
|
* src/sysvinit.c (sysvinit_environ_hint): Fix dimensions.
|
|
State transition algorithm used this far could cause spurious component
wakeups in some cases. Consider the following scenario: being in
runlevel N, the configuration is changed so that a component X is added
at runlevel N. Then a change to runlevel N+1 is initiated. What happens
then is that X is woken up (still being in runlevel N) and terminated
shortly afterwards, upon entering runlevel N+1.
To avoid this, configuration must be reloaded after runlevel changes.
* src/ctl.c (res_runlevel): Don't initiate ACTION_RELOAD after
setting the runlevel.
* src/pies.c (main): Begin main event loop with call
to pies_pause.
* src/pies.h (pies_set_hook): New proto.
(inittrans): Remove proto.
* src/socket.c (pies_set_hook): New function.
(pies_pause): Call pies_pause_hook if defined.
* src/sysvinit.c (inittrans): Change to static.
If transition was initiated by user (e.g. by invoking telinit),
schedule ACTION_RELOAD.
(sysvinit_begin): Set inittrans as pies_hook
|
|
|
|
|
|
|
|
* comp.c (mark_prog): Instead of calling progman_gc, terminate the
prog if it is a deactivated listener.
|
|
* src/comp.c (component_config_commit): Run progman_gc right
after mark stage, to ensure any eventual listener components
are properly closed before being reopened by progman_create_sockets
|
|
|
|
|
|
* src/ctl.c: New endpoint "environ"
* src/pies.h (sysvinit_envlocate)
(sysvinit_envdelete)
(sysvinit_envupdate): New protos.
* src/piesctl.c: New subcommand "telinit environ".
* src/sysvinit.c (sysvinit_envlocate)
(sysvinit_envdelete)
(sysvinit_envupdate): New functions.
(sysvinit_begin): Create allocated copies of
instance and pies_master_argv to avoid them being
rewritten by calls to mf_proctitle_format
|
|
* src/ctl.c (pcond_active): New type.
(pcond_eval): Handle pcond_active.
(pcond_conv): New op: active.
(pcond_conv_find): Skip array elements with NULL term value.
(object_to_cond): Permit empty argument if no
handler function is defined.
(fun_stop): Work on all prog types.
(fun_start): Work only on components.
(fun_restart): Work only on running components.
* src/piesctl.c (cmdline_parser_state): New member: command.
(pcond_parse_unary): Handle "active" keyword.
(parse_condition): Change signature.
(parse_condition_to_uri): Likewise.
(default_cond): New function,
(com_stop, com_start, com_restart): If no arguments supplied,
assume default condition "type component".
(ctlcom_t): Change signature. All uses changed.
(main): Pass a pointer to cmdline_parser_state to the
command handler.
|
|
* src/prog.h (prog): Remove .facility. Use facility from
the component.
(active,wait,stop): Move from union into the main struct.
All uses changed.
|
|
* src/cmdline.opt (parse_options): Change signature.
Handle sysvinit case.
* src/pies.c (set_conf_file_names): Handle sysvinit case.
(main): Move some parts of sysvinit-specific initialization
to set_conf_file_names.
|
|
|
|
|
|
* lib/addrfmt.c: Include limits.h
* src/ctl.c (fun_stop,fun_start): Ignore non-component
progs.
* src/pies.c (request_restart_components): Fix piesctl
invocation.
* src/pies.h (PIES_CHLD_RESCHEDULE_ALARM): New flag.
(progman_wait_until): Remove.
(progman_recompute_alarm): New proto.
* src/progman.c (recompute_alarm): Remove. All uses
raise PIES_CHLD_RESCHEDULE_ALARM instead.
(progman_wake_sleeping): Handle status_stopping components
independently on their activity flag.
(prog_stop_all, progman_wait_until): Remove.
(progman_stop): Rewrite using mark+sweep approach.
|
|
* po/POTFILES.in: Add missing source files.
* grecs: Upgrade.
* src/diag.c (pies_diag_printer): New function.
(logfuncall): New function.
* src/pies.h: Add new prototypes.
* src/pies.c (main): Initialize grecs_print_diag_fun
* src/acl.c: Uniformly use double-quotes in messages. Use
logfuncall where applicable.
* src/comp.c: Likewise.
* src/ctl.c: Likewise.
* src/inetd-bi.c: Likewise.
* src/inetd.c: Likewise.
* src/limits.c: Likewise.
* src/piesctl.c: Likewise.
* src/progman.c: Likewise.
* src/socket.c: Likewise.
* src/sysvinit.c: Likewise.
|
|
* src/inetd-bi.c (tcpmux): Use component_foreach to
handle help requests.
* src/progman.c (progman_iterate_comp): Removed.
* src/pies.h: Likewise.
|