AgeCommit message (Collapse)AuthorFiles
2020-10-18Fix cyclic dependecy detection and reporting.HEADmasterSergey Poznyakoff6
Use modified Floyd-Warshall algorithm for cyclic dependecy detection. The computed next vertex indices are used when reporting the cycles found. This fixes dead loops that occurred in earlier versions when trying to report cycles. One of inputs that caused such behavior is used as a new test in * src/depmap.c: Rewrite using modified Floyd-Warshall algorithm. (depmap_cycle_detect,depmap_path_free): New functions. * src/comp.c (report_cyclic_dependency): Take struct depmap_path * as argument. (component_build_depmap): Use depmap_cycle_detect to detect cyclic dependencies. (depmap_dump): Special handling for zero-sized depmap. * tests/ Add new test. * src/pies.h (depmap_dim, depmap_free) (depmap_cycle_detect,depmap_path_free): New protos. * NEWS: Document changes.
2020-10-17Update copyright yearsSergey Poznyakoff94
2020-10-17Automatically detect if pies is started from dockerSergey Poznyakoff6
* lib/envop.c: Include sys/types.h (for ssize_t). * src/pies.c (is_docker,no_init_option,init_detect): New functions. (main): Call init_detect. * src/utmp.c: Additional cpp magic to determine WTMPX_FILE and UTMPX_FILE. * NEWS: Document the changes. * doc/pies.texi: Likewise. Also, fix improper node name (inetd.conf). * Version 1.4.91
2020-10-12Make sure exited preprocessor gets cleaned up when running with PID 1.Sergey Poznyakoff3
* NEWS: Version 1.4.90 * Version 1.4.90 * src/pies.c (main): When running with PID 1, install a minimal SIGCHLD handler before parsing configuration files.
2020-06-14Fix datetime testsSergey Poznyakoff1
* tests/ (IT_SPECIAL): Force TZ=0 to avoid false failures due to DST.
2020-06-14Use grecs with wordsplit v1.1Sergey Poznyakoff1
2019-07-10Switch to grecs b06fb7d3Sergey Poznyakoff3
2019-07-02Fix doc/manual generationSergey Poznyakoff1
2019-07-02Version 1.4release-1.4Sergey Poznyakoff3
2019-06-24Add missing libintl libraries in testsSergey Poznyakoff1
2019-06-24Minor changesSergey Poznyakoff10
* Minor changes * lib/libpies.h: Add missing include. * src/ (pies_LDADD piesctl_LDADD): Add libintl libs * src/progman.c: Remove useless code. * tests/ Use canonical ordering of options and arguments. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Don't expect GNU sed
2019-06-24Enable/disable SystemV init code at compile timeSergey Poznyakoff11
* New option --enable-sysvinit. Disable the init code if RUN_LVL is not available. (PIES_SYSVINIT_ENABLED): New configuration define. (PIES_COND_SYSVINIT): New condition Print configuration settings summary. * src/pies.h (is_sysvinit): Check for PIES_SYSVINIT_ENABLED. (SYSVINIT_ACTIVE): New macro. * grecs: Upgrade. * src/ Conditionally link sysvinit-related code. * src/cmdline.opt: Disable the --telinit option if sysvinit support is not available. (parse_options): Use SYSVINIT_ACTIVE in the conditional. * src/comp.c (component_verify): Check if component definition is allowed by the current state of the sysvinit support. * src/ctl.c: Disable the /runlevel entry point if sysvinit support is not compiled. * src/diag.c (stderr_open): Make sure sysvinit-related code is not compiled if the sysvinit support is not available. * src/pies.c (config_syntax_tab): Add entry for CONF_INITTAB only if sysvinit support is available. (_cb_initdefault,_cb_runlevels): Remove. Use cb_initdefault and cb_runlevels instead. (component_keywords): Disable runlevels without sysvinit support. (pies_keywords): Same for initdefault. Use SYSVINIT_ACTIVE to suppress compilation of sysvinit code without sysvinit support. * src/progman.c: Use SYSVINIT_ACTIVE to suppress compilation of sysvinit code without sysvinit support. * src/sysvinit.c (cb_initdefault,cb_runlevels): New functions.
2019-06-13Minor fixesSergey Poznyakoff2
* grecs: Pull 12304127b5 * src/pies.c: Fix help message.
2019-06-12Version 1.3.92Sergey Poznyakoff10
2019-06-12More tests for built-in servicesSergey Poznyakoff3
* tests/ Check tcpmux services. * tests/nt.c: Add tcpmux support, improve error checking. * tests/chargen.c: Improve error checking.
2019-06-12Check accept components and inet built-in services.Sergey Poznyakoff14
* src/comp.c (component_verify,component_finish): Fix check for the presense of the "command" statement. * src/pies.c (component_keywords): Reorder some entries for the consistency of config-help output. * tests/.gitignore: Add new files. * tests/ Add new tests and noinst programs. * tests/ New test. * tests/ New test. * tests/chargen.c: New file. * tests/readtime.c: New file. * tests/recvfd.c: Rewrite for testing both accept and pass-fd components. * tests/ Pass -s option to recvfd * tests/ Add new tests. * tests/lines.c: Minor changes. * tests/nt.c: Minor changes. * tests/to.c: Minor changes.
2019-06-11Test pass-fd componentsSergey Poznyakoff7
* tests/recvfd.c: New source. * tests/.gitignore: Update. * tests/ New test. * tests/ Add new test. * tests/ Add new test. * tests/nt.c: Check all revents bits.
2019-06-11Improve the nt tool. Test inet running instance limit.Sergey Poznyakoff8
* tests/ Add new test. * tests/aux/in.test (PIESCTL): Provide the necessary options. Discontinue the use of STOPCMD environment variable. New commands: enable, sleep, touch. * tests/ (PIES_CONTROL_INIT): Rename pidfile to PIES_PIDFILE and ctlsock to PIES_CTLSOCK. Export both. Include * tests/ Use new variables. * tests/ Remove the env block. * tests/iobuf.h (iobuf_copy): Return number of bytes copied. * tests/ New file. * tests/nt.c (netcat_stream_disconnect): New function. (netcat_stream_read): Disconnect the peer stream if no more input is available and the peer is not available for output (i.e. its output buffer is empty). (netcat_stream_write): Stop polling if output buffer is empty. (netcat): Fix event mask
2019-06-10Fix coredumpSergey Poznyakoff1
* src/comp.c (component_build_depmap): Defer removal of the component to the end of the run
2019-06-10BugfixSergey Poznyakoff1
* tests/nt.c: Trivial fixes
2019-06-09Test inetd components.Sergey Poznyakoff12
* lib/ Add urlconn.c * lib/libpies.h (url_connect): New proto. * lib/urlconn.c: New file. * src/piesctl.c (shttp_connect): Use url_connect. * tests/.gitignore: Update. * tests/ New auxtool: aux/in.test New test: * tests/aux/in.test: New file. * tests/ New file. * tests/iobuf.h: New file. * tests/nt.c: New file. * tests/ Add new test. * tests/to.c: explicitly terminate the child process on timeout.
2019-06-07Implement additional env.eval statementSergey Poznyakoff4
2019-06-06Bugfix in grecs (pull c31f6e9769)Sergey Poznyakoff1
2019-06-06Change syntax of the env.clear statement.Sergey Poznyakoff6
It no longer requires an argument. The correct syntax is env { clear; }
2019-06-06Update the grecs submoduleSergey Poznyakoff11
* (GRECS_SETUP): Request the tree-api * grecs: Pull a0c096190f * lib/envop.c (environ_set): Call wordsplit_free unconditionally. * lib/grecsasrt.c (assert_grecs_value_type) (assert_scalar_stmt): Remove. (conf_callback_url): Switch to tree-api. * lib/grecsasrt.h: Likewise. * src/acl.c: Rewrite grecs callbacks in the tree API style. Use grecs assertions. * src/acl.h: Likewise. * src/meta1parse.c: Likewise. * src/pies.c: Likewise. * src/piesctl.c: Likewise. * src/comp.c (component_finish): Check whether the "command" statement was used.
2019-06-03Minor fixesSergey Poznyakoff1
2019-06-03Finish the env re-implementationSergey Poznyakoff9
* NEWS: Document the "env" statement and the PIES_MASTER_PID environment variable. Version 1.3.91 * 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/ Check the legacy env syntax. * tests/ 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/ Pass --no-netrc to piesctl. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ 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/ Update. * tests/ Use to to avoid hanging forever. Add missing popdef. * tests/ Use echo as component program. * tests/ Run pies in foreground. Use to to limit execution time. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Use sleepexit as component program. * tests/ 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/ 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/ Add new tests. * tests/ Add environment tests. * tests/ New file. * tests/envtest.c: New file. * tests/ New file. * tests/ Check first two lines of the output file.
2019-05-31Minor fixSergey Poznyakoff1
* tests/ 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/ Add new tests. * tests/ Add new tests. * tests/aux/respawn: Change default timeout to 1 second. * tests/ Minor change. * tests/ 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/ New test. * tests/ Add new test. * tests/ Likewise. * tests/aux/startup: Rename to tests/aux/touchfile * tests/ 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/ (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/ Start components from $auxdir. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ New file. * tests/ Include * tests/ 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/ Add new test. * tests/ (trimws): New function. * tests/ New test. * tests/ 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/ (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

Return to:

Send suggestions and report system problems to the System administrator.