Age | Commit message (Collapse) | Author | Files |
|
|
|
* grecs: update.
* src/ctl.c: Use "message" everywhere. Remove all uses of
"error_message" attribute.
* src/piesctl.c (shttp_print_response_status): Special handling for
empty responses.
|
|
|
|
* grecs: Pull 1569e6e3f73e5
* src/pies.c: Use grecs_preprocess for preprocessing
* src/piesctl.c: Likewise.
|
|
The installation directory for pp-setup can be set at configure time
using the --with-pp-setup option. To disable installing it, use
--without-pp-setup.
* NEWS: Raise patchlevel.
* configure.ac (DEFAULT_INCLUDE_PATH): New variable.
(PIES_INCDIR): New substitution variable.
New option --with-pp-setup.
* grecs: Pull 7427077b98.
* src/Makefile.am (DEFAULT_VERSION_INCLUDE_DIR)
(DEFAULT_INCLUDE_DIR): Replace by DEFAULT_INCLUDE_PATH.
Install pp-setup conditionally.
* src/cmdline.opt (pies_help_hook): Print include path.
Fix arguments to grecs_find_include_file.
* src/pies.c (config_init): Use DEFAULT_INCLUDE_PATH to
initialize include path.
* src/piesctl.c: Likewise.
|
|
* NEWS: Document changes.
* doc/pies.texi: Document changes.
* src/cmdline.opt: Don't set preprocessor if DEFAULT_PREPROCESSOR
is NULL.
* src/piesctl-cl.opt: New options: --preprocessor,
--no-preprocessor.
* src/piesctl.c (parse_config): If either client.url or
default_url is set in the program-specific config, use it
and don't parse pies.conf. This is consistent with the
documented behavior.
(main): Initialize grecs_preprocessor.
|
|
|
|
* doc/Makefile.am: Add ctl.texi
* doc/ctl.texi: New file.
* doc/pies.texi: Add anchors for ctl.texi
* src/ctl.c (json_error_reply_create): Set status depending on
the HTTP response code.
Use "message", instead of "error_message".
New endpoint: /alive
* src/inetd.c: Use grecs_getline instead of getline.
* src/sysvinit.c: Likewise.
* src/piesctl.c: Inspect "message", instead of "error_message".
|
|
* src/pies.c (string_to_syslog_facility): Take additional length argument.
(string_to_syslog_fp): New function.
(_cb_redir): Accept full facility.priority specification.
* src/piesctl.c: Remove legacy redirector support.
|
|
|
|
|
|
* lib/Makefile.am: 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/Makefile.am: New auxtool: aux/in.test
New test: inet.at
* tests/aux/in.test: New file.
* tests/inet.at: New file.
* tests/iobuf.h: New file.
* tests/nt.c: New file.
* tests/testsuite.at: Add new test.
* tests/to.c: explicitly terminate the child process on timeout.
|
|
It no longer requires an argument. The correct syntax is
env {
clear;
}
|
|
* configure.ac (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.
|
|
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.
|
|
* 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.
|
|
|
|
|
|
|
|
* 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/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.
|
|
|
|
* 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.
|
|
This commit implements the following operations on the new /conf endpoints:
GET /conf/runtime - List configuration
PUT /conf/runtime - Reload configuration
POST /conf/runtime - Post new configuration
GET /conf/files - List configuration files
DELETE /conf/files - Delete some or all configuration files
from the list
POST /conf/files - Install new configuration file
Piesctl supports the following new commands:
piesctl config reload
piesctl config file clear
piesctl config file add SYNTAX NAME
piesctl config file del[ete] NAME [NAME...]
piesctl config file list
* src/ctl.c (res_conf): New function.
(restab): New endpoint /conf
* src/pies.c (config_file_add): Set free_entry.
(config_file_remove, config_file_remove_all)
(config_file_list_serialize): New functions.
(pies_config_parse): Bail out if tree processing fails.
(pies_reload): Remove unused function.
(main): Redo ACTION_RELOAD handling.
Handle ACTION_COMMIT.
* src/pies.h (ACTION_COMMIT): New action.
(config_file_remove, config_file_remove_all)
(config_file_list_serialize)
(pies_read_config, progman_gc): New protos.
* src/piesctl.c (cmdline_parser_state): New struct
(next_token, peek_token): Take ptr to cmdline_parser_state as argument.
(parse_error, require_token, assert_eol)
(piesctl_format): New functions.
(parse_condition_to_uri): Rewrite using piesctl_format.
New subcommand: config.
Improve help output.
|
|
The CF_DISABLED flag is still retained to indicate that the component is
disabled administratively.
* src/prog.h (prog.v.p) <active>: New member.
(IS_ACTIVE_COMPONENT): Use active flag.
* src/comp.c (component_finish): Don't modify component flags.
* src/ctl.c (prog_serialize): Replace attribute "disabled" with
"active".
(fun_stop): Set prog->v.p.active
* src/pies.c (main): Use pies_master_argv to check whether
program name is absolute.
* src/piesctl.c (print_comp): Check "active" attribute.
* src/progman.c (register_prog0): Set prog->v.p.active.
(progman_create_sockets): Remove components if their
socket cannot be opened.
(progman_lookup_tcpmux, prog_open_socket)
(prog_start, progman_start)
(prog_start_prerequisites, react): Operate on prog->v.p.active
to test/change prog's activity state.
* src/sysvinit.c (enablecomp, runlevel_setup_prog): Operate on
prog->v.p.active to test/change prog's activity state.
(demand_prog, IS_RUNNING_DISABLED_PROG): Likewise.
|
|
* src/prog.h (status_enabled, status_disabled): Remove.
(status_stopped, status_running): New modes.
All uses updated.
* src/comp.c (component_finish): Disable ondemand component
by default.
* src/ctl.c (json_object_set_bool): New function.
(pies_status_str): Update.
(prog_serialize): Set "disabled" attribute.
(fun_stop, fun_start): Use CF_DISABLED flag.
(res_runlevel): Schedule ACTION_RELOAD.
* src/pies.h (json_object_set_bool): New proto.
* src/piesctl.c (status_trans): Reflect changes in modes.
(print_comp): Check the "disabled" attribute.
* src/progman.c (register_prog0)
(prog_open_socket,prog_start,prog_stop)
(progman_wake_sleeping)
(prog_start_prerequisites)
(react, progman_cleanup)
(progman_stop_component): Update.
(no_children_left): Fix.
* src/sysvinit.c (enablecomp): Make CF_DISABLED flag
persist for ondemand components.
(runlevel_setup_prog): Use CF_DISABLED flag.
(inittrans): Stop inactivated processes.
* doc/pies.texi: Update.
|
|
* src/pies.h: Include json.h
(sysvinit_report, sysvinit_set_runlevel)
(json_object_set_string, json_object_set_number): New protos.
* src/ctl.c (ctlio_resource)<predicate>: New member.
(restab): New endpoint: runlevel. Available only if run
as pid 1.
(find_resource): If predicate is not NULL, call it to
confirm that the endpoint is available.
* src/piesctl.c: New subcommand "telinit".
* src/sysvinit.c (sysvinit_set_runlevel): New function.
(sysvinit_fifo_handler): Implement on-demaind components.
|
|
|
|
* configure.ac (GRECS_SETUP): Request sockaddr-list
* grecs: Upgrade.
* po/POTFILES.in: Remove meta.c
* src/piesctl-cl.opt: Use client.url
* src/piesctl.c (client_conn): New struct.
(instance_keywords,piesctl_keywords): New keyword: "source".
(parse_config): Initialize grecs_sockaddr_hints.
(shttp_connect): Optionally bind to the selected local IP
before connecting.
* src/utmp.c (write_wtmpx,write_utmpx): Remove spurious notice.
|
|
* configure.ac (DEFAULT_CONTROL_URL): Rename to
DEFAULT_PIES_CONTROL_URL. Change default value.
(DEFAULT_INIT_CONTROL_URL): New subst variable.
* lib/libpies.h (pies_basic_url_create): New prototype.
* lib/url.c (pies_basic_url_create): New function (renamed
from pies_url_create).
(pies_url_create): Expand variable references in the input string.
* src/Makefile.am (AM_CPPFLAGS): Pass DEFAULT_INIT_CONTROL_URL
* src/ctl.c (pies_control_url)
(ctl_open): Don't exit on errors, return -1 instead.
* src/pies.c (default_control_url): New variable.
(config_parse): Create default socket url.
(pies_control_url): New macro
(main): Set environment variable PIES_INSTANCE.
Try to open control socket in init process mode as well.
* src/pies.h (default_control_url): New extern.
(ctl_open): Change prototype.
(pies_control_url): Remove.
* src/piesctl-cl.opt (parse_options): Set environment variable
PIES_INSTANCE.
* src/piesctl.c (parse_config): Use pies_url_create and
DEFAULT_PIES_CONTROL_URL when falling back to the default socket.
|
|
|
|
|
|
* src/piesctl.c (EX_OK, EX_NOTFOUND): New defines.
(exit_status): New global.
(all calls): Use EX_OK instead of literal 0
(shttp_process): Set exit_status on errors.
(com_list, com_id): Return void. Check response code.
(com_stop, com_start)
(com_restart, com_reboot): Return void.
(ctlcom_t): Return void.
(main): Return exit_status
|
|
* ctl.c (res_instance): Include "argv" in the return json.
Use pies_master_argv[0] to report binary path.
* pies.c (pies_master_argv,pies_master_argc): New globals.
(main): Initialize them.
Refuse to restart unless argv[0] begins with a slash.
* pies.h (pies_master_argv,pies_master_argc): New globals.
* piesctl.c (com_id): Rewrite output formatting.
|
|
|
|
* grecs: Upgrade.
* src/ctl.c (restab): Split /programs in two endpoints.
(eval_env): New members allowed_state, fun, total_count,
success_count, and noperm_count.
(pcond_type): pcond_and and pcond_or can take arbitrary
number of arguments. All uses updated.
(selector): Rewrite.
* src/piesctl.c: All commands that operate on components take
conditional expression as argument.
(pcond_parse_and)
(pcond_parse_or): Optimize consecutive operations.
|
|
* src/ctl.c (res_instance)
(res_programs): Take partial URI as argument (instead of full
URI split on path delimiter)
(ctlio_resource): New member uri_len; Change signature of handler.
(find_resource): Compare URI prefix.
(ctlio_do_command): Redo URI parsing. Improve error checking.
* src/piesctl.c (shttp_print_error): New function.
(shttp_fatal): Print error on 404 and 409 responses.
|
|
* src/ctl.c: Start textual descriptions with capital letters.
* src/piesctl-cl.opt: Fix typos.
* src/piesctl.c (shttp_process): Fix error handling.
(shttp_fatal): Select exit code depending on the HTTP response code.
|
|
* src/piesctl.c (comtab): New members: argdoc and docstr.
(command_help): New function.
(main): Set proginfo.print_help_hook
* po/POTFILES.in: add missing files.
|
|
|
|
Old control options (--status, --restart-components) rewritten using
piesctl.
SIGUSR1 and SIGUSR2 no longer handled.
* lib/arraymember.c (array_index): New function.
* lib/libpies.h: Likewise.
* src/cmdline.opt: Fix copyright years.
* src/piesctl-cl.opt: Likewise.
* src/ctl.c (ctlio_do_command): Implement restart.
(pies_control_url): New function.
(eval_env): rename json to result.
New member cond.
Restore pcond_ functions.
(json_to_pcond): New function.
(res_programs): Conditional selection of programs to list.
Implement restart.
* src/pies.c (ctlfile, statfile): Remove.
(pies_keywords): Mark control-file and stat-file as inactive.
(default_sigv): Remove SIGUSR1 and SIGUSR2
(pies_check_status): Don't send SIGUSR2.
(stop_components): Remove.
(request_restart_components): Rewrite as a wrapper.
Call piesctl to do the job.
(list_components): New function.
* src/pies.h (ACTION_COMPRELOAD)
(ACTION_DUMPSTATS): Remove. All callers changed.
(progman_dump_stats): Remove.
* src/piesctl.c (shttp_request_send): Don't initialize conn->req; the
caller is responsible for that.
(parse_condition, json_to_string)
(parse_condition_to_uri): New functions.
(com_list): Read conditional expression from the command line.
(com_restart): Implement.
* src/progman.c (progman_dump_stats): Remove.
|
|
|
|
* configure.ac (DEFAULT_CONTROL_URL): New subst variable.
* grecs: Upgrade.
* ident/pam.c (overwrite_and_free): Free ptr.
* lib/Makefile.am: Add new sources.
* src/addrfmt.c: Move to lib/addrfmt.c
* lib/grecsasrt.c: New file.
* lib/grecsasrt.h: New file.
* lib/mkfilename.c: New file.
* lib/netrc.c: New file.
* lib/pp.c: New file.
* lib/split3.c: New file.
* src/url.c: Move from lib/url.c
(pies_url_free_user, pies_url_free_passwd): New finctions.
* lib/libpies.h (strsplit3): New proto.
(pies_url_create, pies_url_destroy)
(pies_url_get_arg, pies_url_copy)
(pies_url_free_user, pies_url_free_passwd)
(netrc_scan)
(pp_add_option, pp_command_line, mkfilename)
(sockaddr_to_str, sockaddr_to_astr): New protos
* src/Makefile.am (bin_PROGRAMS): New program: piesctl
(pies_SOURCES): Remove addrfmt.c and url.c.
(noinst_HEADERS, BUILT_SOURCES): Add piesctl-cl.h
* src/cmdline.opt: Use pp_* function family to build
preprocessor command line.
* src/ctl.c (http_header_hash): Use case-insensitive hashing.
(ctlio_finalize_reply): Don't close connection after sending 401
response.
(input): Remove ws and wsflags. All uses changed.
(input_append): Use strsplit3 to parse the request line.
* src/pies.c: Use pp_* function family to build
preprocessor command line.
Move assert_, mkfilename and _cb+_url functions into libpies.
* src/pies.h (pies_sockaddr_storage): Move to libpies.h
* src/piesctl.c: New file.
* src/piesctl-cl.opt: New file.
|