summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/proc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* remove tautological conditionbenno2020-08-031-2/+2
| | | | | from Ross L Richardson <openbsd AT rlr DOT id DOT au>, Thanks ok claudio@
* During the fork+exec implementation, daemon(3) was moved afterbluhm2018-09-091-5/+16
| | | | | | | proc_init(). As a consequence httpd(8) and relayd(8) child processes did not detach from the terminal anymore. Dup /dev/null to the stdio file descriptors in the children. OK benno@
* use __func__ in log messages.benno2017-05-281-5/+5
| | | | | From Hiltjo Posthuma hiltjo -AT codemadness -DOT- org, thanks! ok florian, claudio
* Nuke some whitespace that keeps poking me in the eye as I try tokrw2017-01-171-2/+2
| | | | steal code.
* Stop accessing verbose and debug variables from log.c directly.reyk2017-01-091-2/+2
| | | | | | | | This replaces log_verbose() and "extern int verbose" with the two functions log_setverbose() and log_getverbose(). Pointed out by benno@ OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)
* Prevent fd exhaustion in the parent when loading the listening serverreyk2016-10-121-6/+25
| | | | | | | | sockets by sending the fd one-by-one. This allows to start httpd with max 32 server instances and many server sockets without changing the default rlimits in any way. OK rzalamena@
* Modify httpd(8)'s proc.c to use less file descriptors during the daemonrzalamena2016-10-101-66/+73
| | | | | | | | | | start up. To achieve this proc_init() initiates only the necessary pipes between child and parent, allocate and distribute fds in proc_connect(). In case of configuration checks ('-n') we do nothing in proc_init() and proc_connect(). ok reyk@
* Fix msgbuf_write() usage idiom and modify the treatment for socket closerzalamena2016-10-101-2/+8
| | | | | | to exit gracefully instead of fatal()ing. ok reyk@
* Add more context to fatal*() messages so it makes easier to debug proc.crzalamena2016-10-101-12/+11
| | | | | | internals. ok phessler@
* Check if oldd == newd before dup2(), if that is the case we need to removerzalamena2016-10-051-2/+8
| | | | | | the CLOEXEC flag ourselves. ok bluhm@, deraadt@
* Call setsid() to create a new session for the executed processes.reyk2016-10-051-1/+5
| | | | | From deraadt@ OK rzalamena@
* sync proc.c with vmd: add p_pw to specify a non-standard user for a process.reyk2016-10-051-3/+9
| | | | OK rzalamena@
* sync proc.c from switchd, includes minor cast qual fix and removal of p_env.reyk2016-09-281-3/+2
|
* Replace [RELAY|SERVER]_MAXPROC with the new PROC_MAX_INSTANCESreyk2016-09-031-3/+3
| | | | | | | variable and limit it from 128 to 32 instances (the old value). While here, move a few PROC_ defines around. OK rzalamena@
* Use DPRINTF instead of #ifdef DEBUG + log_debug().reyk2016-09-031-4/+2
| | | | Pointed out by benno@
* proc.c tweaks: Rename proc_listento() to proc_accept() as it is thereyk2016-09-021-23/+43
| | | | | | | | receiving side of proc_connect(). Move some code from main into proc_init(), the function is now called by parent and children, not just the parent and it is less copy + paste for other daemons. OK florian@
* Don't print "lost child" if the child process exited okay. This isreyk2016-09-011-3/+5
| | | | the old behaviour and unbreaks the regress tests.
* spacingreyk2016-09-011-2/+3
|
* Adjust log message, use process title now that it works againreyk2016-09-011-4/+6
|
* Teach httpd/proc.c how to fork+exec.rzalamena2016-09-011-160/+271
| | | | | | | | This commit implemented the basic functions to proc.c to make it not rely on global variables, malloc()ed memory and CLOEXEC pipes. Fix child proc titles from reyk@ ok reyk@, florian@
* Kill (remove) the ps_pid from privsep struct since it is not being usedrzalamena2016-08-301-3/+2
| | | | | | anymore. Also fix the process initialization prototypes. ok reyk@
* Terminate daemon using the socket status instead of watching SIGCHLD orrzalamena2016-08-301-10/+24
| | | | | | | kill()ing child process. "Looks good to me" millert@ ok benno@
* Kill p_instance from proc.c and remove static proc_id unused variables.rzalamena2016-08-271-7/+6
| | | | | | | | | To keep the debug functionality intact and correct we'll use the pid field in the imsg header to pass the instance number. Remember to always pass 'ps_instance + 1' otherwise libutil will fill imsg header pid field with the imsgbuf pid (which is the current process pid). ok reyk@
* Kill the ps_ninstances from proc.c.rzalamena2016-08-261-10/+12
| | | | | | | We got the same information in ps_instances[proc] (more accurate) and we avoid allocating unnecessary memory for pipe storage. ok reyk@
* Add imsg "peerid" to debug messages (only within -DDEBUG).reyk2015-12-071-5/+7
|
* EAGAIN handling for imsg_read. OK henning@ benno@claudio2015-12-051-2/+2
|
* sync with relayd, use proc_compose()reyk2015-12-021-6/+20
|
* Retire socket_set_blockmode() in favor of the SOCK_NONBLOCK type flag.reyk2015-11-231-5/+3
| | | | | | As done in iked and snmpd. OK jung@
* Sync proc.c with iked.reyk2015-11-231-4/+13
|
* Update log.c: change fatal() and fatalx() into variadic functions,reyk2015-11-221-9/+11
| | | | | | | include the process name, and replace all calls of fatal*(NULL) with fatal(__func__) for better debugging. OK benno@
* Change httpd(8) to use C99-style fixed-width integers (uintN_t insteadreyk2015-08-201-18/+19
| | | | | | | | | | | | | | | | of u_intN_t) and replace u_int with unsigned int. Mixing both variants is a bad style and most contributors seem to prefer this style; it also helps us to get used to it, portability, and standardization. Theoretically no binary change, except one in practice: httpd.o has a different checksum because gcc with -O2 pads/optimizes "struct privsep" differently when using "unsigned int" instead "u_int" for the affected members. "u_int" is just a typedef of "unsigned int", -O0 doesn't build the difference and clang with -O2 doesn't do it either - it is just another curiosity from gcc-land. OK semarie@
* httpd is based on relayd and had included many headers that are onlyreyk2015-01-211-6/+2
| | | | | | | | | needed by its ancestor. jsg@, include-what-you-use, and some manual review helped to cleanup the headers (take iwyu with a grain of salt). Based on common practice, httpd.h now also includes the necessary headers for itself. OK florian@
* Stop pulling in <arpa/inet.h> or <arpa/nameser.h> when unnecessary.guenther2014-12-211-2/+1
| | | | | | *Do* pull it in when in_{port,addr}_h is needed and <netinet/in.h> isn't. ok reyk@
* Replace setpgrp(0, getpid()) with setpgid(0, 0). OK deraadt@ tedu@millert2014-12-161-2/+2
|
* Remove unnecessary netinet/in_systm.h include.lteo2014-10-251-2/+1
| | | | ok millert@
* Add initial support for log files in /var/www/logs/. Logging withreyk2014-08-041-1/+4
| | | | | | syslog is still supported but disabled by default. ok deraadt@
* httpd doesn't support SSL/TLS yet, remove the remaining bits.reyk2014-08-041-3/+1
| | | | The secrect plan is to add it later using the ressl wrapper library.
* whitespacederaadt2014-08-041-2/+2
|
* Add httpd(8), an attempt to turn the relayd(8) codebase into a simplereyk2014-07-121-0/+627
web server. It is not finished yet and I just started it today, but the goal is to provide an HTTP server that a) provides minimal features, b) serves static files, c) provides FastCGI support, and d) follows common coding practices of OpenBSD. It will neither support plugins, nor custom memory allocators, EBCDIC support, PCRE or any other things that can be found elsewhere. httpd(8) is not intended to provide a fully-featured replacement for nginx(8) or the Apache, but it will provide enough functionality that is needed in the OpenBSD base system. ok deraadt@