aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2019-06-03Finish the env re-implementationSergey Poznyakoff9
* 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.
2019-06-02Speed up tests.Sergey Poznyakoff8
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.
2019-06-02Rewrite the testsuiteSergey Poznyakoff17
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.
2019-06-02New configuration statement for manipulating the environment.Sergey Poznyakoff16
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.
2019-05-31Minor fixSergey Poznyakoff1
* tests/shell.at: Append to the outfile instead of overwriting it.
2019-05-31Provide an option to run commands via sh -cSergey Poznyakoff10
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.
2019-05-28Permit stdout redirection for startup and shutdown components.Sergey Poznyakoff1
* src/progman.c (register_prog0): Preserve comp->redir[RETR_OUT].type for exec, startup, and shutdown components.
2019-05-28Document startup and shutdown componentsSergey Poznyakoff2
2019-05-24Implement shutdown componentsSergey Poznyakoff7
* 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.
2019-05-24Don't remove finished startup components. Just mark them with status_finished.Sergey Poznyakoff5
* 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.
2019-05-24Initial implementation of "startup" components.Sergey Poznyakoff17
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.
2019-05-23Update NEWSSergey Poznyakoff1
2019-05-23Update copyright yearsSergey Poznyakoff67
2019-05-23Revise dependency handling. Correctly display cyclic dependencies.Sergey Poznyakoff7
* 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.
2019-05-20Upgrade grecsSergey Poznyakoff7
2019-05-20Document the --no-init option. Raise version number to 1.3.90Sergey Poznyakoff3
2019-05-17Provide an option to disable SysV init mode.Sergey Poznyakoff2
This is useful if pies is run as a entrypoint process in a docker container.
2019-05-17Fix coredump in components_dump_depmapSergey Poznyakoff1
Coredump was triggered by detected cyclic dependency.
2019-02-10Minor fixSergey Poznyakoff1
* src/Makefile.am (install-data-hook): Add missing DESTDIR (Reported by Rafael Fontenelle).
2019-02-10Fix typosSergey Poznyakoff2
Spotted by Rafael Fontenelle.
2018-05-20BugfixSergey Poznyakoff1
* src/pies.c (setsigvhan): Fix setting signals
2017-01-02Happy GNU YearSergey Poznyakoff71
2016-10-01Version 1.3release-1.3Sergey Poznyakoff2
2016-08-20Fix environment modification codeSergey Poznyakoff1
Port fixes from GNU rush
2016-07-16Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/piesSergey Poznyakoff2
2016-07-16Don't concatenate adjacent strings in configuration files.Sergey Poznyakoff5
* grecs: Upgrade. * src/pies.h: Fix include paths. * src/piesctl.c: Likewise. * NEWS: Document changes. * doc/pies.texi: Likewise.
2016-04-07Remove duplicate includesSergey Poznyakoff2
2016-03-24BugfixSergey Poznyakoff1
* lib/split3.c: Return correct error code.
2016-03-19Add testsuteSergey Poznyakoff17
2016-03-19BugfixesSergey Poznyakoff2
* src/pies.c (main): Issue the start-up message after eventual changing to background and the corresponding reconfiguration of diagnostic output channel. * src/piesctl.c (parse_condition_to_uri, com_id): Fix checking for arguments.
2016-03-19Fix some compilation issues on SolarisSergey Poznyakoff5
* configure.ac: Check for libnsl * src/pies.c (string_to_syslog_facility): LOG_AUTHPRIV and LOG_FTP may be undefined. * src/piesctl.c (EX_NOTFOUND): Rename to EX_PIES_NOTFOUND. (com_list): Use default_cond. * src/sysvinit.c (console_stty): Make sure CBAUDEX is defined. * src/utmp.c (fill_utmp): Declare locals right before using them.
2016-03-15version 1.2.94Sergey Poznyakoff2
2016-03-15Update NEWS and READMESergey Poznyakoff2
2016-03-12Spell-checkSergey Poznyakoff1
2016-03-07Improve docsSergey Poznyakoff2
* doc/pies.texi: Document piesctl and identity providers. * src/piesctl.c: Fix reference to the docs.
2016-03-07Fix pies -ESergey Poznyakoff1
* src/pies.c (main): Fix syntax type comparison.
2016-03-06Reimplement the telinit legacy interface.Sergey Poznyakoff7
pies -T is now fully compatible with the legacy telinit command * src/telinit.opt: New file. * src/Makefile.am: Add telinit.opt * src/cmdline.opt (-T): Remove explicit variable. Rest of command line is processed specially. * src/pies.h (telinit): Change prototype. * src/sysvinit.c (telinit): Rewrite. * src/.gitignore: Update. * doc/pies.texi: Document telinit.
2016-03-05ACL reference statements.Sergey Poznyakoff4
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.
2016-03-05Use pies_schedule_action instead of assigning action directly.Sergey Poznyakoff1
2016-03-02Improve docsSergey Poznyakoff1
2016-03-02BugfixesSergey Poznyakoff3
* 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
2016-03-02Configurable pathname of the emergency shellSergey Poznyakoff3
* configure.ac (EMERGENCY_SHELL): New arg_var. * src/Makefile.am (AM_CPPFLAGS): Define EMERGENCY_SHELL. * src/sysvinit.c (emergency_shell): Initialize with the value of EMERGENCY_SHELL.
2016-03-01Improve documentationSergey Poznyakoff2
* doc/Makefile.am (check-sub-config): Fix regexps. * doc/pies.texi: Document init operation.
2016-03-01BugfixSergey Poznyakoff1
* src/sysvinit.c (sysvinit_environ_hint): Fix dimensions.
2016-02-28Synchronize changes in runlevel with configuration reloadsSergey Poznyakoff5
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
2016-02-28Minor changeSergey Poznyakoff1
2016-02-26Minor fixSergey Poznyakoff1
2016-02-26piesctl: minor formatting changeSergey Poznyakoff1
2016-02-26Improve previous commit.Sergey Poznyakoff1
* comp.c (mark_prog): Instead of calling progman_gc, terminate the prog if it is a deactivated listener.
2016-02-26Fix reconfiguration codeSergey Poznyakoff1
* 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

Return to:

Send suggestions and report system problems to the System administrator.