aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2016-01-09Use grecs meta1 parserSergey Poznyakoff9
* configure.ac (GRECS_SETUP): Require parser-meta1 * grecs: Upgrade. * po/POTFILES.in: Update. * src/Makefile.am: Remove meta1gram.y and meta1lex.l Add meta1parse.c and meta1parse.h * src/meta1gram.y: Remove. * src/meta1lex.l: Remove. * src/meta1parse.c: New file. * src/meta1parse.h: New file. * src/pies.c: Include meta1parse.h instead of meta1lex.h
2016-01-09BugfixesSergey Poznyakoff2
* src/meta1gram.y: Translate "wait" mode to "exec". * src/diag.c (logmsg_vprintf): Don't loose the last segment before \n.
2016-01-09piesctl: optionally bind to local IPSergey Poznyakoff7
* 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.
2016-01-08Uniformly use grecs memory management functions.Sergey Poznyakoff24
* gnulib.modules: Remove unneded modules. * ident/ident.h: Remove xalloc.h, include errno.h * ident/ident.c: Use standard allocation functions instead of x* * ident/pam.c: Remove. * ident/provider.c: Remove. * ident/system.c: Remove. * src/meta.c: Remove. * src/Makefile.am: Remove meta.c * src/progman.c: Use grecs_* allocation functions instead of x*. (notify): Use wordsplit to expand variables within message. Rename variables: program-name to program_name; canonical-program-name to canonical_program_name. * doc/pies.texi: Update. * src/depmap.c: Use grecs_* allocation functions instead of x*. (depmap_end): New function. * src/diag.c (logmsg_vprintf): Use grecs_txtacc instead of obstack. * src/pies.h (depmap_end): New proto. Remove unused includes. * src/acl.c: Use grecs_* allocation functions instead of x*. * src/ctl.c: Likewise. * src/inetd.c: Likewise. * src/limits.c: Likewise. * src/meta1gram.y: Likewise. * src/meta1lex.l: Likewise. * src/pies.c: Likewise. * src/socket.c: Likewise. * src/sysvinit.c: Likewise. * src/userprivs.c: Likewise.
2016-01-08Enable control socket when run as init process.Sergey Poznyakoff11
* 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.
2016-01-08BugfixSergey Poznyakoff1
* lib/addrfmt.c (S_UN_NAME): Fix comparison. (sockaddr_to_str): Improve wording.
2016-01-08BugfixesSergey Poznyakoff3
* bootstrap.conf (bootstrap_epilogue): Declare the package as a GNU one. * configure.ac: Require gettext 0.19 Remove useless conditional * src/ctl.c (fun_stop, fun_start): Check prog->v.p.status, not the CF_DISABLED flag.
2016-01-06Revert to pre-32a337f3 two endpoint systemSergey Poznyakoff2
2016-01-05control interface: pass JSON as query for GET, DELETE, and PUTSergey Poznyakoff2
2016-01-05piesctl: normalize exit codes.Sergey Poznyakoff1
* 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
2016-01-05Include argv in the output of ctl id command.Sergey Poznyakoff4
* 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.
2016-01-05Minor changes.Sergey Poznyakoff4
* src/ctl.c (ctlio_authenticate): Configurable realm name. (ctlio_do_command): Check the Accept header. * src/inetd.c (inetd_conf_file): Change line_no type. * src/pies.c (control_keywords): New keyword: realm. * src/pies.h (control) <realm>: New member.
2016-01-05Insert missing _() markersSergey Poznyakoff2
2016-01-05Select components to operate upon using conditional expressionSergey Poznyakoff3
* 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.
2016-01-04Redo URI handling.Sergey Poznyakoff2
* 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.
2016-01-04Minor fixesSergey Poznyakoff3
* 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.
2016-01-04Improve piesctl help outputSergey Poznyakoff2
* 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.
2016-01-03Minor changesSergey Poznyakoff6
2016-01-03Minor changesSergey Poznyakoff3
* configure.ac: Version 1.2.92 * src/ctl.c (ctlio_finalize_reply): Don't close connection on errors. * src/pies.h (PIES_PRINTFLIKE): New macro. (logmsg, logmsg_printf): Mark as printflike.
2016-01-02Switch to new control interface.Sergey Poznyakoff9
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.
2016-01-02piesctl: Implement all basic commands, except "restart"Sergey Poznyakoff3
2015-12-31Command-line control interface.Sergey Poznyakoff21
* 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.
2015-12-25ctl: use numeric type for PIDS and wakeup time values.Sergey Poznyakoff2
2015-12-25REST control protocol.Sergey Poznyakoff4
* configure.ac (GRECS_SETUP): Add json * gnulib.modules: Add base64. * grecs: Upgrade. * src/ctl.c: Rewrite as REST.
2015-12-20Bugfixes in init modeSergey Poznyakoff5
* src/ctl.c (ctl_open): Add missing return. * src/pies.c (config_parse): Return if tree is null. (main) [INIT_EMU]: Print more info. Override default init_fifo. Don't use syslog and control socket if running as init process. * src/pies.h (init_fifo): New extern. * src/progman.c (open_redirector): Return -1 if running as init process. (prog_start): Always initialize redir[]. * src/sysvinit.c (init_fifo): New variable. Use it instead if the INIT_FIFO macro. (inittrans): Call create_fifo once, when transiting from boot to normal state.
2015-12-19Update grecsSergey Poznyakoff1
2015-12-17FixesSergey Poznyakoff2
* src/ctl.c: Make "id" command accessible only to administrators (cmd_id): Print PID. (ctlio_do_command): Reword 510 text. * src/pies.c (config_file): Remove "next" (conf_head, conf_tail): Remove. Use grecs_list instead. All uses changed.
2015-12-17Improve is_group_member functions.Sergey Poznyakoff2
* ident/pam.c: Use is_array_member as intended. * ident/system.c: Likewise.
2015-12-17Implement user privilegesSergey Poznyakoff5
* src/pies.h (component): New members: list_acl and adm_acl. (control): Removed id_acl. New members: adm_acl and usr_acl. * src/pies.c (component_keywords): New keywords list-acl and admin-acl. Removed identity-acl. * ident/ident.c (pies_identity_user_name): New function. * ident/identity.h (pies_identity_user_name): New proto. * src/ctl.c (CTL_USER_STATE,CTL_ADMIN_STATE): New states. (cmdtab): Mark administrative commands as valid in CTL_ADMIN_STATE (ctlio_create): Assume CTL_ADMIN_STATE in the absense of identity providers. (auth_data): New struct. (cmd_auth): Select appropriate state depending on the user permissions. (list_matches): New function. (eval_env): Keep the list of selected progs. (count_prog): Removed. (selector): New function. (cmd_list): Rewrite to take into account access rights. (cmd_start,cmd_stop) (cmd_restart): Only allowed for users with administrative privileges.
2015-12-16Minor fixes.Sergey Poznyakoff8
* grecs: Upgrade. * lib/parsetime.c: Fix senseless compiler warnings. * src/acl.c: Fix docstrings. * src/meta1gram.y (yyerror): Change argument * src/meta1lex.l: Add flex options * src/pies.h (meta1error): Change signature. * src/progman.c (prog_lookup_by_socket): Remove. * src/sysvinit.c (sysvinit_stop_filter): Remove.
2015-12-16Update grecsSergey Poznyakoff1
2015-12-16Update gnulibSergey Poznyakoff5
2015-12-16Implement authentication on control socket.Sergey Poznyakoff21
* Makefile.am (SUBDIRS): Add src. * configure.ac: Check for crypt.h and PAM Build ident/Makefile * grecs: Update. * ident/Makefile.am: New file. * ident/ident.c: New file. * ident/ident.h: New file. * ident/identity.h: New file. * ident/pam.c: New file. * ident/provider.c: New file. * ident/system.c: New file. * lib/Makefile.am: Add arraymember.c * lib/arraymember.c: New file. * lib/libpies.h (is_array_member): New proto. * src/Makefile.am (LDADD): Add libident.a and @PAM_LIBS@ * src/acl.c (acl_entry): Remove groups. Add new members: names and name_match. (pies_acl_create): Deep copy the locus. Set free_entry function for the list. (pies_acl_free): Free locus. (_parse_from): Set free_entry function for the list. (_parse_group): Parse the "user" construct. (parse_acl_line): Deep copy the locus. Allow for null value. (acl_keywords): Update docstrings. (_acl_check): Rewrite identity checks. * src/acl.h (acl_input)<user,groups>: Remove. <identity>: New member. (pies_acl_free): New proto. * src/ctl.c (identity): New global. (cmdtab): New command: auth (ctlio) <addr,addrlen>: New members. (ctlio_create): Start from authenticated state only if no identity_providers are configured. (cmd_auth): New function. (cmd_help): Print only commands that are available in the current state. (ctl_accept): Initialize io->addr and io->addrlen. * src/inetd-bi.c: Change call to check_acl * src/pies.c: Include identity.h (control_keywords): New statement "identity-acl" (pies_keywords): New statement "identity-provider" (config_init): Register identity mechanisms. (config_parse): New function. (config_help): Print help on identity-provider statements. (main): Use config_parse to parse grecs-style configurations. * src/pies.h: Include identity.h (check_acl): Change argument list. All callers changed. (control): Remove acl. Add conn_acl and id_acl instead. * src/progman.c (check_acl): Change argument list. Take identity as the 3rd argument.
2015-11-25Fix descriptor leakSergey Poznyakoff2
* src/progman.c (prog_start): Close redirection fd's * grecs: Upgrade.
2015-11-22BugfixesSergey Poznyakoff2
* src/ctl.c (cmd_reboot, ctl_shutdown): Use code 221 to indicate that we are going to close clonnection (ctlwr): Check return from write. * src/pies.c: Handle SIGPIPE
2015-11-05New ctl commands: start, stop, restart, reboot, shutdown.Sergey Poznyakoff5
* src/ctl.c (CTL_ACTION_STATE): New state. (cmdtab): Add new commands: start, stop, restart, reboot, shutdown. (ctlio)<action>: New member. (ctlio_create): Initialize action. (list_prog): List scheduled wakeup time for sleeping components. (cmd_start,cmd_stop) (cmd_restart,cmd_reboot,cmd_shutdown): New functions. (ctlwr): Handle CTL_ACTION_STATE. * src/pies.c (pies_schedule_action): New function. (stop_components): Use progman_stop_tag(). * src/pies.h (pies_schedule_action, progman_stop_tag): New protos. (progman_stop_component): Remove. * src/prog.h (progman_locate, progman_stop_component): New protos. * src/progman.c (progman_locate): New function. (progman_cleanup): Set status depending on the CF_DISABLED bit. (progman_stop_component): Take struct prog* as argument. (progman_stop_tag): New function.
2015-10-31control socket: list typesSergey Poznyakoff3
* src/ctl.c: list prog types and search on them * src/progman.c (progman_foreach): Iterate over all elements, not only components. * src/sysvinit.c (runlevel_setup_prog): Check if prog is a component.
2015-10-31Implement list control command.Sergey Poznyakoff5
* src/ctl.c: Implement list. * src/prog.h (IS_COMPONENT): New macro (from progman.c) * src/progman.c: Move IS_COMPONENT to src/prog.h * src/socket.c (create_socket): Clear uid, gid and umaskval for inet sockets.
2015-10-30Introduce control connection.Sergey Poznyakoff6
* src/ctl.c: New file. * src/Makefile.am (pies_SOURCES): Add ctl.c * src/pies.c: New configuration statement "control" * src/pies.h (instance, ctl_url): New externs. (register_socket): Change signature. (update_socket,ctl_open): New protos. * src/socket.c (listenset): Remove. (fdset): New static. (sockinst)<handler>: Array of three pointers: handlers for read, write, and exception, correspondingly. (find_socket_handler): Remove. (register_socket): Take three function pointers as arguments. Update corresponding elements of fdset. (update_socket): New function. (pies_pause): Handle all three I/O operations. (deregister_socket) (register_program_socket) (disable_socket,enable_socket): Reflect the changes. * src/sysvinit.c (create_fifo): Update call to register_socket.
2015-08-14Fix doc generation.Sergey Poznyakoff1
The default Config file applies to all output formats, which is wrong. Use a dedicated configuration file for html output formats, and defaults for the rest. * doc/Config: Rename to doc/html.init (with changes).
2015-03-01Switch to Texinfo 5.0Sergey Poznyakoff6
* doc/Config: Rewrite. * doc/Makefile.am: Use Makeinfo 5 instead of texi2htm * doc/gendocs_template: Ps is not built * imprimatur: Upgrade.
2015-01-21New component flag: nullinputSergey Poznyakoff5
* NEWS: Update. * doc/pies.texi: Document nullinput flag. * src/pies.c (str_to_cf): New flag: nullinput * src/pies.h (CF_NULLINPUT): New flag. * src/progman.c (prog_start): If CF_NULLINPUT flag is set, redirect /dev/null to the stdin
2014-12-27Minor fixes.Sergey Poznyakoff6
* lib/proctitle.c (mf_proctitle_format): Check return from vasprintf instead of checking the return pointer. * src/inetd-bi.c: Check return values from write where reasonable. * src/progman.c (redirect_to_file): Check return from chown. (close_fds): Fix coredump (upper boundary was wrong). (open_redirector, progman_dump_stats): Check return values. * src/sysvinit.c (sysvinit_setenv): Remove unused variable. * src/userprivs.c (str_eq, str_dispose): Remove unused functions. * src/utmp.c: Check return values.
2014-12-26Implement globbing patterns in include statements.Sergey Poznyakoff5
* grecs: Upgrade. * doc/pies.texi: Document built-in include and line directives. * src/cmdline.opt: New option -I (--include-directory). * configure.ac: Version 1.2.91 * NEWS: Update.
2014-06-11Init emulator mode; bugfix.Sergey Poznyakoff2
* src/pies.c (main) [INIT_EMU]: Enable "init emulator" mode. * src/sysvinit.c (enablecomp) (sysvinit_runlevel_setup): Use struct enstate to pass information to the callback. This fixes bug introduced by the previous commit, which caused "wait" keyword to be ignored.
2014-06-09Implement ctrlaltdel and kbrequest processes.Sergey Poznyakoff5
* src/sysdep.c: New file. * src/Makefile.am (pies_SOURCES): Add sysdep.c * src/pies.c (ACTION_*): Move to pies.h (sig_handler): Call sysvinit_sigtrans, return immediately if it handles the signal. (setsigvhan): New function. (add_extra_sigv): New function. (signal_setup): Rewrite. (main): Handle ACTION_CTRLALTDEL and ACTION_KBREQUEST. * src/pies.h (PIES_COMP_DEFAULT) (PIES_COMP_WAIT,PIES_COMP_MASK): New defines. (pies_action): New enum, add new actions: ACTION_CTRLALTDEL and ACTION_KBREQUEST. (setsigvhan, add_extra_sigv) (sysvinit_sigtrans,sysvinit_runlevel_setup) (sysvinit_sysdep_begin): New protos. (sysvinit_request) <pad>: Rename to data. * src/sysvinit.c (enablecomp): Change meaning of the data pointer. (sysvinit_runlevel_setup): Change signature. Remove static qualifier. All uses changed. (sysvinit_setenv): New static. (sysvinit_fifo_handler): Handle INIT_CMD_SETENV. (sysvinit_sigtrans): New function. (sysvinit_begin): Set up new signals. Call sysvinit_sysdep_begin.
2013-12-18Upgrade grecsSergey Poznyakoff4
2013-01-07Add function for parsing /etc/inittab.Sergey Poznyakoff5
* src/limits.c (free_limits): New function. * src/pies.c (config_syntax): Move to pies.h (config_syntax_tab): New type "inittab" (free_action,component_free): New functions. (component_finish): Call component_free to discard the failed component. (main): In sysvinit mode, default to reading two configuration files: /etc/inittab and /etc/pies.init. Don't exit on configuration errors in this mode. * src/pies.h (str_to_config_syntax) (add_config,free_redirector) (component_free,free_limits) (inittab_parse): New protos. * src/progman.c (free_redirector): New function. * src/sysvinit.c (inittab_parse): New function.
2013-01-07Fix sysvinit execution environment, simplify boot state system.Sergey Poznyakoff7
* src/pies.c (_cb_runlevels): Bugfix. (set_console_dev): Move to sysvinit.c * src/pies.h (progman_sysvinit_enable): Remove proto. (console_open, telinit): New protos. (sysvinit_environ_hint): New extern. * src/prog.h (prog_stop): New proto. * src/progman.c (env_concat): Bugfix. (env_concat): In sysvinit mode, apply sysvinit_environ_hint to the environment. (console_open, console_stty): Move to sysvinit.c * src/sysvinit.c (boot_state): Simplify state set. (getinitdefault, askrunlevel): New functions. (sysvinit_runlevel_setup): New function. (enablecomp): Change signature to match progman_foreach API. (sysvinit_begin): Prepare console, become a session leader, prepare environment. (inittrans): Call sysvinit_runlevel_setup * src/socket.c (calc_fd_max): Fix return type. * src/acl.c (acl_copy): Remove unused variable.
2013-01-06Update copyright years.Sergey Poznyakoff42

Return to:

Send suggestions and report system problems to the System administrator.