aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
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
2013-01-06Fix runlevel transition algorithm, implement SysV-style fifo interface.Sergey Poznyakoff9
* src/prog.h: New file. * src/Makefile.am: Add new file. * src/cmdline.opt: New option --telinit (-T). * src/diag.c (vlogmsg): In sysvin it mode, write directly to the console. Close it when finished. * src/pies.c (_cb_initdefault, _cb_runlevels): Use is_valid_runlevel to check if the specified runlevels are ok. (main): In sysvinit mode, reset action to ACTION_CONT. * src/pies.h (progman_filter): New proto. (progman_accept,register_socket): Change signature. (deregister_socket): New proto. (register_program_socket): New proto. * src/progman.c: Move constant and adatatype definitions to prog.h (prog_stop): Remove static qualifier. (console_open): Likewise. (progman_accept): Use new socket API. (progman_stop): Correctly handle timeouts. (progman_foreach): New function. * src/socket.c: Register all sockets along with their handlers in a doubly-linked list. (sockinst): New struct. (register_socket,deregister_socket): New functions. (register_program_socket): New function. (pies_pause): Traverse the list to find which fd has changed. Use its registered handler to handle the event. * src/sysvinit.c: Include prog.h (is_valid_runlevel): New function. (sysvinit_fifo_handler,check_fifo): New static functions. (inittrans): Fix transition algorithm. (telinit): New function.
2013-01-05Write utmp/wtmp records in sysvinit mode.Sergey Poznyakoff6
* configure.ac: Check for utmp.h, utmpx.h * src/utmp.c: New file. * src/Makefile.am: Add utmp.c * src/pies.h (sysvinit_acct): New proto. * src/progman.c (prog_start, progman_cleanup): Call sysvinit_acct. * src/sysvinit.c (inittrans): Call sysvinit_acct. Set proctitle.
2013-01-04Fix sysvinit transition logic.Sergey Poznyakoff4
* src/pies.c (main): Call sysvinit_begin to initialize sysvinit subsystem. In the main loop, force wakeup if inittrans returns 1. * src/pies.h (is_sysvinit): Rewrite macro. (progman_sysvinit_enable): New proto. (inittrans): Change return type. * src/progman.c (progman_sysvinit_enable): New function. (progman_running_p): Additional debugging. (prog_start): Special handling for sysvinit components. Remove calls to runlevel_match * src/sysvinit.c (runlevel_match): Remove function. (sysvinit_begin): New function. (inittrans): Return boolean value indicating whether a transition has been made. Call progman_sysvinit_enable to change the status of sysvinit components as appropriate.
2013-01-04Minor fixes.Sergey Poznyakoff3
* src/pies.c (modetab): Discern between "wait" and "respawn". * src/progman.c (progman_cleanup): Mark a terminated sysvinit component as status_finished.
2013-01-04Fix grecs usageSergey Poznyakoff1
2013-01-04Implement runlevel transitions.Sergey Poznyakoff5
* src/sysvinit.c: New file. * src/Makefile.am: Add new file. * src/pies.c (initdefault, dfl_level): Move to sysvinit.c (modetab): Add new modes. (inittrans): Move to sysvinit.c * src/pies.h (is_sysvinit): New macro. (dfl_level): New extern. (runlevel_match, inittrans, is_comp_wait): New protos. * src/progman.c (progman_running_p): Take into account only components. Use is_comp_wait to determine if the component should be waited for. (prog_start): Run sysvinit components only when started as init process. (runlevel_match): Move to sysvinit.c (prog_start_prerequisites): Return immediately if the component is disabled.
2013-01-04Initial support for running as init process.Sergey Poznyakoff8
* 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.
2012-12-04Bugfix.Sergey Poznyakoff1
* src/meta1lex.l: Fix mistyped preproc directive.
2012-07-23Bugfix.Sergey Poznyakoff1
* src/progman.c (prog_stop): Access v.p.comp->flags only if the argument points to a component.
2012-07-15Upgrade imprimatur.Sergey Poznyakoff1
2012-05-26Fix saturation of the connection table.Sergey Poznyakoff2
* src/progman.c (conn_class_copy): Zero out the source after copying (fix typo). (conn_class_lookup): Bail out if grecs_symtab_lookup_or_install fails. (conn_class_report): Take two arguments, the first one being the priority to use for logging. All uses changed. (conn_class_remove): New function. (progman_cleanup): Call conn_class_remove when the number of connections for that class reaches zero.
2011-10-24Document siggroup flag.Sergey Poznyakoff2
2011-10-23Minor fix.Sergey Poznyakoff1
* doc/Makefile.am (check-options): Change to match the recent changes.
2011-10-23Switch to the latest Grecs.Sergey Poznyakoff21
* 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.
2011-10-08Use Imprimatur for docs processing.Sergey Poznyakoff12
* .gitmodules: Add imprimatur. * Makefile.am (ACLOCAL_AMFLAGS,SUBDIRS): Add imprimatur. * configure.ac: Require gettext 0.18. Call IMPRIMATUR_INIT. Define ATTRIBUTE_NORETURN, if not defined already. * doc/Makefile.am: Use imprimatur. Drop files that are no longer necessary. * doc/check-docs.sh: Delete. * doc/fix-sentence-spacing.sed: Delete. * doc/mastermenu.el: Delete. * doc/rendition.texi: Delete. * doc/untabify.el: Delete. * doc/pies.texi: Use @: where appropriate. * src/pies.c (main): Use _() instead of N_().
2010-03-17Remove pidfile when exiting or restarting.Sergey Poznyakoff1
* src/pies.c (main): Remove pidfile after exiting the event loop.
2010-01-02Update copyright years.Sergey Poznyakoff41
Happy GNU Year!
2010-01-02New keyword "siggroup" + bugfix.Sergey Poznyakoff3
* src/pies.c (str_to_cf): New keyword "siggroup". * src/pies.h (CF_SIGGROUP): New constant. * src/progman.c (prog_start): Call setsid in child. (check_stopping): If CF_SIGGROUP, send signal to the process group. (prog_stop): If CF_SIGGROUP, send signal to the process group. (send_msg,run_command): Call setsid in child. (progman_cleanup): Bugfix: check if prog->v.p.cclass is not NULL (it can be, for UDP services).
2009-12-23Limit number of connections per socket (IP).Sergey Poznyakoff4
* src/inetd-bi.c (fd_write): Remove. Use fd_report instead. * src/pies.c (component_keywords): New keywords: max-instances-message, max-ip-connections, max-ip-connections-message, access-denied-message. * src/pies.h (struct component): New members: max_ip_connections, access_denied_message, max_instances_message, max_ip_connections_message. (fd_report): New extern. * src/progman.c (conn_class): New struct. (struct prog.p): New member cclass. (conn_tab): New static. (conn_class_lookup, conn_class_report): New functions. (progman_run_comp): Set cclass. (fd_report): New function. (_prog_accept): In case of failure (access denied, etc.) optionally send response strings over the fd. Limit number of connections per socket (IP). (progman_cleanup): Update cclass counter.
2009-12-23Update grecs to edcc575b.Sergey Poznyakoff1
2009-12-16Bugfixes.Sergey Poznyakoff2
* src/diag.c (vlogmsg): Copy va_list before printing it to stderr. * src/progman.c (print_status): First arg is const.
2009-12-15Handle multiple MeTA1 servers.Sergey Poznyakoff1
* src/meta1gram.y: Handle multiple MeTA1 servers with different tags.
2009-12-12Minor fixes.release-1.2Sergey Poznyakoff1
* src/Makefile.am: Fix rules for inetd.
2009-12-11Final cleanup for version 1.2.Sergey Poznyakoff6
* configure.ac (INETD_SH): Rename to INETD. * NEWS: Update. * src/.gitignore (inetd.sh): rename to inetd. * doc/pies.texi: Update. * src/Makefile.am (pkgstatedir): New variable. (AM_CPPFLAGS): Add define. (inetd.sh): Replace with inetd. (install-exec-hook): Remove. * src/pies.c (statedir): New variable. (pies_keywords): New keyword: "state-directory". (set_file_names): Split in two functions: (set_conf_file_names, set_state_file_names). (main): Call set_conf_file_names before, and set_state_file_names after parsing the configs.
2009-12-11Finish the docs.Sergey Poznyakoff2
* doc/inetd.texi: Update. * doc/pies.texi: Update.
2009-12-11New meta-variable for notifications.Sergey Poznyakoff1
* src/progman.c (notify): New meta-var "instance".
2009-12-11Bugfixes.Sergey Poznyakoff2
* src/meta1gram.y (xlat_listen_socket): Handle all relevant assignments in the listen_socket block. * src/url.c (url_parse_host): Always assign port_s. Handle arguments without preceding path. (url_parse_user): Parse path without preceding user/pass specs. (url_parse_scheme): Require exactly two slashes after 'scheme:'.
2009-12-10Document state files and instances.Sergey Poznyakoff1
* doc/pies.texi: Update.
2009-12-10Improve status output.Sergey Poznyakoff2
* doc/pies.texi: Document new status output format. * src/progman.c (progman_dump_stats): Redesign flags column.
2009-12-10Upgrade grecs.Sergey Poznyakoff1
2009-12-10Improve docs + bugfix.Sergey Poznyakoff5
* doc/inetd.texi: New file. * doc/Makefile.am: Add inetd.texi. * doc/pies.texi, doc/usr-acl.texi: Update. * src/pies.c (socktype_xtab): SOCK_PACKET not always defined.
2009-12-10UpdateSergey Poznyakoff4
* doc/macros.texi (xprindex) (example-output, mtasimopt): Remove (RFC): New macro. * doc/pies.texi: Document inetd-style components. * doc/Makefile.am (fix-sentence-spacing): Fix rule. * src/progman.c (progman_lookup_tcpmux): Use case-insensitive comparison, as required by RFC.
2009-12-09Improve docs.Sergey Poznyakoff3
* doc/fix-sentence-spacing.sed: New file. * doc/Makefile.am (EXTRA_DIST): Add fix-sentence-spacing.sed. (check-tabs, check-sentence-spacing) (fix-sentence-spacing): New rules. (check-format): Rewrite rule. * doc/pies.texi: Update.
2009-12-02Minor changesSergey Poznyakoff2
* doc/pies.texi: Update * src/progman.c (run_command): handle return-code for inetd components.
2009-11-29New option --instance.Sergey Poznyakoff1
2009-11-28Optionally provide an inetd wrapper.Sergey Poznyakoff4
* configure.ac: New option --enable-inetd * src/inetd.in: New file. * src/.gitignore: Add inetd.sh. * src/Makefile.am (inetd.sh): New goal. (install-exec-hook): New rule.
2009-11-28Handle per-tcpmux ACL's. Optionally pass socket data via environment variables.Sergey Poznyakoff5
* src/inetd-bi.c (tcpmux): Consult the component's ACL before deciding whether to handle the connection. * src/pies.c (str_to_socket_type): Rewrite using strtotok. (socket_type_to_str): New function (str_to_cf): New flags: sockenv and resolve. Use strtotok. (main): Log_tag defaults to program instance name. * src/pies.h: Include socket-related headers. (CF_SOCKENV, CF_RESOLVE): New flags. (pies_sockaddr_storage): New union. (check_acl): New proto. (progman_run_comp): Change signature. (socket_type_to_str): New proto. * src/progman.c (struct prog): New members sa_storage, sa_len. (prog_sockenv): New function. (progman_run_comp): Call prog_sockenv. Initialize sa_storage and sa_len of the created struct prog. (prog_start): Call prog_sockenv. Do not close 2 if logging to stderr. (check_acl): Remove static. (_prog_accept): Use union pies_sockaddr_storage. Pass socket address in pinst->v.p.sa_storage and pinst->v.p.sa_len. (sockenv_hint, envsize): New variables. (add_env): New function. (env_setup): Remove. (environ_setup): New function. * src/socket.c: Remove unnecessary includes.
2009-11-26Switch to grecs master.Sergey Poznyakoff1
2009-11-26Fix config-help outputSergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.