aboutsummaryrefslogtreecommitdiff
path: root/src/inetd.c
AgeCommit message (Collapse)AuthorFiles
2019-05-23Update copyright yearsSergey Poznyakoff1
2017-01-02Happy GNU YearSergey Poznyakoff1
2016-02-23Improve loggingSergey Poznyakoff1
* 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.
2016-01-21Cleanup: redo configuration file handling and dependency tracking.Sergey Poznyakoff1
Implement clean configuration reload on SIGHUP. Use SIGUSR1 to restart the program (previously initiated by SIGHUP). * src/Makefile.am (pies_SOURCES): Add comp.c * src/comp.c: New file. * src/acl.c (pies_acl_free): Don't coredump on NULL arg. (_parse_from): Set cmp function for the sockaddr list. (_acl_common_section_parser): Set cmp function for the ACL (pies_acl_cmp): New function. * src/acl.h (pies_acl_cmp): New proto. * src/cmdline.opt: Remove option --dump-prereq. Add options --trace-prereq and --trace-depend. * src/ctl.c: Use prog_tag to access tag of struct prog. * src/depmap.c (depmap_clear) (depmap_clear_all): New functions. * src/inetd.c (inetd_conf_file): Don't register prog right away. This is done later in component_config_commit. (inetd_parse_conf): Rename to inetd_config_parse. * src/limits.c (limits_cmp): New function. * src/pies.c (config_file): Replace with struct config_syntax. (str_to_config_syntax): Return a pointer to struct config_syntax. (add_config): Rename to config_file_add. (config_file_add_type): New function. (return_code_keywords, create_action): Change handling of actions. (return_code_section_parser): Likewise. (component_verify, component_create) (component_free, component_finish): Move to comp.c (config_parse): Remove. (pies_config_parse): New function. (pies_read_config,pies_reload): New function. (pies_reload): Rename to request_reload. (pies_status): Rename to request_status. (pies_stop): Rename to request_stop. (main): Change configuration file handling. SIGHUP reloads configuration, instead of restarting the program. (default_sigv,sig_handler): Handle SIGUSR1. * src/pies.h (component): New members: prev, next, listidx, arridx, ref_count, prog. Remove act_head, act_tail, act_temp. Add new prototypes. * src/prog.h (prog): Remove tag and prereq. * src/progman.c (prog_tag): New function. (destroy_prog): Update component reference count. (register_redir): Likewise. (register_prog0): Take one argument. Update component reference count. (register_prog): Update comp->prog (prog_rebuild_prerequisites): Remove. (component_fixup_depend): Remove. (fixup_prerequisites,rebuild_prerequisites) (print_dep,progman_dump_prereq) (progman_dump_depmap,progman_build_depmap): Remove. (prog_start_prerequisites): Scan depmap to find prerequisites. (prog_stop_dependents): Likewise. (progman_wait): Remove. (progman_wait_until): New function. (progman_stop): Rewrite using progman_wait_until. (react): Rewrite using grecs_list * src/sysvinit.c: Use prog_tag when needed. * src/userprivs.c (pies_privs_cmp, pies_privs_free): New functions. * grecs: Update. * lib/safe_strcmp.c: New file. * lib/Makefile.am: Add safe_strcmp.c * lib/libpies.h (safe_strcmp): New proto.
2016-01-08Uniformly use grecs memory management functions.Sergey Poznyakoff1
* 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-05Minor changes.Sergey Poznyakoff1
* 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.
2013-01-06Update copyright years.Sergey Poznyakoff1
2013-01-04Initial support for running as init process.Sergey Poznyakoff1
* grecs: Upgrade. * lib/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. * src/Makefile.am: Likewise. * src/acl.c: Update grecs_keyword definitions. * src/inetd.c (inetd_conf_file): Bugfix. The ws structure could be free'd prior to initialization. * src/pies.c: Update grecs_keyword definitions. (init_process,initdefault,dfl_level): New globals. (modetab) <once>: New keyword. (component_keywords)<runlevels,initdefault>: New keywords. (main): Initial support for init(8) mode. * src/pies.h (pies_comp_mode) <pies_comp_exec_once>: New constant. (component)<runlevels>: New member. (init_process,console_device,initdefault): New externs. * src/progman.c (prog_status)<status_finished>: New status. (prog)<runlevels>: New member. (progman_running_p): New function. (prog_start): Special handling for init process mode. (progman_start): Likewise. Take into account runlevels. (progman_dump_stats): New flag 'f' for status_finished.
2011-10-23Switch to the latest Grecs.Sergey Poznyakoff1
* Makefile.am (ChangeLog): Use git2chg.awk to build it. * NEWS: Update. * bootstrap.conf (gnulib_modules): Grecs does not depend on gnulib any more. * configure.ac: Version 1.2.90. Define GRECS_HOST_PROJECT_INCLUDES, remove grecs Makefiles from AC_CONFIG_FILES: it is now done by GRECS_SETUP itself. * gnulib.modules (gitlog-to-changelog,argp): Remove. (configmake): New module. * grecs: Update to a52ab6c6. * lib/libpies.h: Remove redefinitions of _() and N_(). * src/Makefile.am: Update for the recent grecs. * src/acl.c: Rewrite using Grecs support for lists and symtabs. * src/acl.h: Likewise. * src/diag.c: Likewise. * src/inetd.c: Likewise. * src/meta1gram.y: Likewise. * src/meta1lex.h: Likewise. * src/meta1lex.l: Likewise. * src/pies.c: Likewise. * src/pies.h: Likewise. * src/progman.c: Likewise. * src/userprivs.c: Likewise.
2010-01-02Update copyright years.Sergey Poznyakoff1
Happy GNU Year!
2009-11-26Implement internal inetd services in the pies config.Sergey Poznyakoff1
* src/pies.h (CF_INTERNAL): New flag. (ISCF_TCPMUX): New macro. (struct component): Reorder fields. New field: tcpmux. (progman_lookup_service): Remove proto. (progman_lookup_tcpmux): New proto. (struct inetd_builtin.foo): Change signature. All uses updated. * src/progman.c (progman_lookup_service): Remove. (progman_lookup_tcpmux): New function. (progman_create_sockets): Skip tcpmux subservices. (progman_start): Skip disabled inetd components. * src/inetd-bi.c (tcpmux): Use progman_lookup_tcpmux. * src/inetd.c (tcpmux_service, mktag): New functions. (inetd_conf_file): Minor changes. * src/pies.c (_cb_bitmask, _cb_precious) (_cb_disabled, _cb_wait): Remove. (str_to_cf, _cb_flags): New functions. (component_keywords): Remove keywords: disable, precious, wait. Add keywords: flags, service, tcpmux-master. (component_verify): Improve. * src/url.c (pies_url_destroy): Fix coredump on NULL argument.
2009-11-25Implement TCPMUX internal service.Sergey Poznyakoff1
* src/pies.h (CF_TCPMUX, CF_TCPMUXPLUS): New flags. (struct component): New member: service. (progman_lookup_service, progman_run_comp) (progman_iterate_comp): New protos. * src/progman.c (progman_iterate_comp) (prog_lookup_by_service) (progman_lookup_service): New functions (prog_start_prologue, prog_execute): New functions, extracted from prog_start. (progman_run_comp): New function. (prog_start): Replace extracted parts of code with calls to prog_start_prologue and prog_execute. * src/inetd-bi.c: Implement TCPMUX * src/inetd.c (inetd_conf_file): Handle tcpmux extries.
2009-11-24Implement inetd builtin services.Sergey Poznyakoff1
* src/inetd-bi.c: New file. * src/Makefile.am (pies_SOURCES): Add inetd-bi.c. * src/pies.h (struct component): New member `builtin'. (qotdfile): New extern. (inetd_builtin): New struct. (inetd_builtin_lookup): New proto. * src/progman.c (prog_start): Handle internal services. * src/inetd.c (inetd_conf_file): Handle internal services. * src/pies.c (qotdfile): New global. (pies_keywords): New keyword "qotd-file".
2009-11-24Implement inetd connection rate.Sergey Poznyakoff1
* src/pies.h (struct component): New member "max_rate". (default_max_rate): New extern. * src/progman.c (check_rate): New function. (check_spawn_rate, check_connection_rate): New functions. (prog_open_socket): New function. (prog_start): Rewrite using the above functions. (_prog_accept): Check connection rate. (progman_start): Special handling for inetd listeners. (progman_wake_sleeping): Likewise. * src/pies.c (default_max_rate): New global. (component_keywords): New keyword max-rate. (options): New option "rate". (parse_opt): Handle the new option. * src/inetd.c (inetd_conf_file): Set max_rate, instead of max_instances.
2009-11-24Implement parsing of inetd.conf files.Sergey Poznyakoff1
* src/Makefile.am (pies_SOURCES): Add inetd.c. * src/inetd.c: New file. * src/pies.c (inetd_mode): New global. (str_to_socket_type): New function. (_cb_socket_type): Use str_to_socket_type. (_cm_include_meta1): Rename to _cb_include_meta1. (_cb_include_inetd): New function. (pies_keywords): New keyword "include-inetd". (options): New option --inetd. (main): Handle inetd mode. * src/pies.h (str_to_socket_type): New proto. (disable_socket, enable_socket): Fix return type. * src/progman.c (redirect_to_file): Avoid coredump on privs.user == NULL. (open_redirector,env_setup) (progman_start,run_command): Remove unneeded variable. (progman_start): Fix diagnostic message. * src/socket.c (disable_socket, enable_socket): Fix return type. Do nothing if fd < 0. * src/userprivs.c (switch_to_privs): Allow to pass uid==0.

Return to:

Send suggestions and report system problems to the System administrator.