From 6dd0ec08db301984b8f8f9082f28006d5915c183 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Fri, 24 May 2019 12:45:25 +0300 Subject: Initial implementation of "startup" components. 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. --- tests/aux/mailer | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 tests/aux/mailer (limited to 'tests/aux/mailer') diff --git a/tests/aux/mailer b/tests/aux/mailer new file mode 100755 index 0000000..f832ff5 --- /dev/null +++ b/tests/aux/mailer @@ -0,0 +1,7 @@ +#! /bin/sh + +exec >${1:?} +shift +echo $* +cat - + -- cgit v1.2.1