Age | Commit message (Collapse) | Author | Files |
|
* 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.
|
|
This complements 6aac230c. The entry is created unless
a component for runlevel S already exists.
* src/comp.c (component_foreach): New function.
* src/pies.h: Likewise.
* src/sysvinit.c (inittab_parse): Provide default S
entry unless one is already defined.
|
|
Improper dereferencing occurred when trying to access master
prog of a redirector.
* src/prog.h (prog) <r.comp>: New member.
* src/progman.c (destroy_prog) <TYPE_COMPONENT>: Clear master
pointers in both redirectors.
<TYPE_REDIRECTOR>: Check if master is NULL.
(register_redir): Initialize r.comp.
|
|
|
|
* grecs: Upgrade.
* src/acl.c (_acl_common_section_parser): Free old value.
* src/pies.c: Mark statically initialized keywords with
GRECS_CONST.
|
|
* src/pies.c (_cb_command,_cb_env): Free wordsplit struct.
(main): Allocate log_tag. Otherwise it might get overwritten
by mf_proctitle_format.
|
|
* src/sysvinit.c (inittab_parse): Provide default entry if
inittab cannot be read or if it defined no components.
* src/comp.c (component_list_is_empty): New function.
* src/pies.c (pies_read_config): Always return 0 in init mode.
(main): Use LOG_DAEMON in init mode.
* src/pies.h (component_list_is_empty): New proto.
|
|
* src/comp.c (component_config_commit): Correctly handle
empty list of components.
|