of integral parts which share global variables, functions, and macros
with the rest of httpd.
Converted now:
prefork, worker, event, simple, WinNT*
*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
configurations with multiple listening sockets.
PR: 42829
Submitted by: Joe Orton, with some tweaking and testing from me
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@732451 13f79535-47bb-0310-9956-ffa450edef68
setting for epoll that will trip up many prefork users. Write
a log message instead of crashing.
PR: 46467
As rpluem notes, some Apache doc is in order.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@732414 13f79535-47bb-0310-9956-ffa450edef68
and get it working with old MPMS[1] + mod_unixd. It's still an uneasy
split, as some modules (mod_cgid, suexec)[2] also use unixd.
More thinking+hacking due.
[1] Should be prefork/worker/event, but only worker is tested.
[2] cgid is OK, suexec is untested.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711146 13f79535-47bb-0310-9956-ffa450edef68
fails with EINTR and die_now has been set (indicating a graceful
stop/restart), terminate the child quickly rather than re-entering
poll().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@613260 13f79535-47bb-0310-9956-ffa450edef68
connections if shutdown_pending is set, i.e. when SIGTERM is received
in single-proecss mode.
Submitted by: Garrett Rooney <rooneg apache.org>
PR: 38848
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@552029 13f79535-47bb-0310-9956-ffa450edef68
* configure.in: Check for getpgid.
* include/mpm_common.h (ap_mpm_safe_kill): New prototype.
* server/mpm_common.c (reclaim_one_pid): Ensure pid validity before
calling apr_proc_wait().
(ap_mpm_safe_kill): New function.
* server/mpm/prefork/prefork.c, server/mpm/worker/worker.c,
server/mpm/experimental/event/event.c: Use ap_mpm_safe_kill() on pids
from the scoreboard, throughout.
* include/ap_mmn.h: Minor bump.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551843 13f79535-47bb-0310-9956-ffa450edef68
* server/mpm_common.c (ap_wait_or_timeout): Remove dead code; NEED_WAITPID
has never been defined by the 2.x build system.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551823 13f79535-47bb-0310-9956-ffa450edef68
ap_get_server_description().
High-level summary:
The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive.
Third-party modules must now use ap_get_server_banner() or
ap_get_server_description() in place of ap_get_server_version().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
to allow modules to review interdependent configuration directive
values and adjust them while messages can still be logged to the
console.
The open_logs phase is already used somewhat for this purpose by
certain MPMs (winnt, prefork, worker, and event) but only by forcing
their functions ahead of the core ap_open_logs() function, and
since this phase runs after the ap_signal_server function during startup,
it can not be used to generate messages on the console when restarting.
Add the check_config phase to mod_info and mod_example.
Handle relevant MPM directives during this phase and format messages
for both the console and the error log, as appropriate. Bounds and sanity
checks on the values of the MPM directives are handled in sequence in
this phase instead of in the various directive handling functions, since
those functions (e.g., set_max_clients()) may not be called at all if their
directives do not appear in the configuration files, and even if they
are called, there is no guarantee that this will occur in any particular
order.
Remove from the worker and event MPMs the code in the pre_config phase
that alters the configuration node tree by re-ordering ThreadsPerChild
ahead of MaxClients. This code is effective but insufficient; for
example, if ServerLimit follows MaxClients, the test against server_limit
in set_max_clients() is invalid. (In practice, this only results in
incorrect or absent warnings on the console, because server_limit is
set to its configured value when the main loop re-runs the configuration
process.)
Prevent ap_threads_per_child from exceeding thread_limit in the
winnt, worker, and event MPMs. This situation could occur if
ThreadsPerChild was not specified in the configuration files and
ThreadLimit was set to a value smaller than DEFAULT_THREADS_PER_CHILD,
because set_threads_per_child() would never be called and therefore
its bounds check against thread_limit would not be performed.
Remove from the winnt, prefork, worker, and event MPMs the
changed_limit_at_restart flag. Set the first_server_limit and
first_thread_limit values during the first execution of the check_config
function, and use them to detect changes to ServerLimit and ThreadLimit
across restarts and issue appropriately formatted warnings. Remove the
comments about the error log being a "bit bucket"; this was true when
the code was originally committed in r92530 but that was due to a bug
fixed in r92769.
Be consistent about setting all MPM configuration directive values in the
pre_config phase.
Rephrase and reformat the console and log file messages relating to
MPM configuration directives to be consistent across all MPMs. Use
briefer messages when logging to the error log than to the console.
Update miscellaneous stale comments and messages (e.g., reference to
daemons_min_free in worker and event MPMs, "prefork open_logs" in
winnt MPM, and StartServers in netware MPM).
The winnt, netware, beos, and mpmt_os2 MPMs should be tested by developers
with access to those platforms, especially the winnt MPM, which has
unique logic with respect to distinguishing between parent and child
processes during the configuration phases.
Update the English documentation for the worker MPM's ThreadsPerChild
directive, which no longer needs to precede other MPM directives in the
configuration files if it has a non-default value. The German (.de) and
Japanese (.ja) translations should be updated by developers fluent in
those languages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@431460 13f79535-47bb-0310-9956-ffa450edef68
a function I think, especially with the fact that
the mapping of getpid() to APR_PID_T_FMT isn't
consistant in some areas.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265506 13f79535-47bb-0310-9956-ffa450edef68
replace with the new ap_relieve_child_processes() call. Add a sleep() call now,
as we lost the timeout inherent in ap_wait_or_timeout(). 1 second seems a sane
choice.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240466 13f79535-47bb-0310-9956-ffa450edef68
first).
General approach is to send SIGUSR1 to all children (which will de-listen, and
exit when finished), and to gather all children as they exit.
We don't use a sleep(timeout) for the timeout implementation, because this
would lead to a rut of defunct children until the timeout had expired.
set_graceful_shutdown stolen from Ken Coar. See <3E84B1EC.3050007@Golux.Com>
(28 Mar 2003).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240270 13f79535-47bb-0310-9956-ffa450edef68
change;
1.) httpd -k graceful sends SIGUSR1 to the parent pid, which in turn
sends SIGUSR1 to all of the active children,
2.) Active children each close their copy of listener fd's.
This means that the listening sockets are freed for re-use. In the ordinary
case, this makes no difference. However if for example admin changes "Listen
80" to "Listen 81" in the config, this rev makes port 80 immediately available
(no waiting for the graceful children to die).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239711 13f79535-47bb-0310-9956-ffa450edef68
while) since the current limit is too small for at least one high end site.
Submitted by: Colm MacCarthaigh [colm stdlib.net]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102347 13f79535-47bb-0310-9956-ffa450edef68
* server/mpm/prefork/prefork.c:
(listensocks[]): removed. not required.
(child_main): stop using listensocks[] in favor of an apr_pollset_t. if
there is just one listener, then always refer to that listener's
listen_rec for further processing, otherwise poll and pick up the
listen_rec pointer from the polling structure's client_data. tweaked
the round-robin for the new pollset API (and documented).
cleaning: removed 'offset' which is obviated by the use of a pointer
to a listen_rec. tighten the block-scope of several variables.
switch to use a 'status' variable name rather than three separately
named variables. rename n->numdesc to be more obvious.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101799 13f79535-47bb-0310-9956-ffa450edef68