mpm_common.c revision 2d399cd7535887fceaa9f8f116eb98ce68ddd602
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl/* ====================================================================
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner * The Apache Software License, Version 1.1
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * Redistribution and use in source and binary forms, with or without
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * modification, are permitted provided that the following conditions
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * 1. Redistributions of source code must retain the above copyright
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * notice, this list of conditions and the following disclaimer.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * 2. Redistributions in binary form must reproduce the above copyright
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * notice, this list of conditions and the following disclaimer in
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * the documentation and/or other materials provided with the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * distribution.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * 3. The end-user documentation included with the redistribution,
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * if any, must include the following acknowledgment:
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * "This product includes software developed by the
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * Apache Software Foundation (http://www.apache.org/)."
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * Alternately, this acknowledgment may appear in the software itself,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * if and wherever such third-party acknowledgments normally appear.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * 4. The names "Apache" and "Apache Software Foundation" must
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * not be used to endorse or promote products derived from this
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * software without prior written permission. For written
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * permission, please contact apache@apache.org.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * 5. Products derived from this software may not be called "Apache",
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * nor may "Apache" appear in their name, without prior written
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * permission of the Apache Software Foundation.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8ecdb62fa2cef068eb4dbce59f3219a8e3adc0baChristian Maeder * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
0f35e410ce3d3202f6769e9d139ad26d1de69b8eAdrián Riesco * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * SUCH DAMAGE.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * ====================================================================
6d498b6f56ed9f71cced898b6c42fb48f6e60583Adrián Riesco * This software consists of voluntary contributions made by many
6e121321775373fe11161d23c541437456df19b4Adrián Riesco * individuals on behalf of the Apache Software Foundation. For more
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * information on the Apache Software Foundation, please see
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * Portions of this software are based upon public domain software
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * originally written at the National Center for Supercomputing Applications,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * University of Illinois, Urbana-Champaign.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco/* The purpose of this file is to store the code that MOST mpm's will need
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * this does not mean a function only goes into this file if every MPM needs
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * it. It means that if a function is needed by more than one MPM, and
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * future maintenance would be served by making the code common, then the
a74f814d3b445eadad6f68737a98a7a303698affChristian Maeder * function belongs here.
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * This is going in src/main because it is not platform specific, it is
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * specific to multi-process servers, but NOT to Unix. Which is why it
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * does not belong in src/os/unix
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maedervoid ap_reclaim_child_processes(int terminate)
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder long int waittime = 1024 * 16; /* in usecs */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* don't want to hold up progress any more than
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * necessary, but we need to allow children a few moments to exit.
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * Set delay with an exponential backoff.
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder /* now see who is done */
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder for (i = 0; i < max_daemons; ++i) {
6e121321775373fe11161d23c541437456df19b4Adrián Riesco waitret = apr_proc_wait(&proc, NULL, NULL, APR_NOWAIT);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* ok, now it's being annoying */
9e0e436980397412aa6c10b9aebde527ca2474bfChristian Maeder "child process %ld still did not exit, "
9e0e436980397412aa6c10b9aebde527ca2474bfChristian Maeder "sending a SIGTERM",
9e0e436980397412aa6c10b9aebde527ca2474bfChristian Maeder /* die child scum */
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder "child process %ld still did not exit, "
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder "sending a SIGKILL",
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* sending a SIGKILL kills the entire team on BeOS, and as
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco * httpd thread is part of that team it removes any chance
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * of ever doing a restart. To counter this I'm changing to
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * use a kinder, gentler way of killing a specific thread
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * that is just as effective.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* gave it our best shot, but alas... If this really
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * is a child we are trying to kill and it really hasn't
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * exited, we will likely fail to bind to the port
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * after the restart.
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco "could not make child process %ld exit, "
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco "attempting to continue anyway",
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco /* nothing left to wait for */
6d498b6f56ed9f71cced898b6c42fb48f6e60583Adrián Riesco#endif /* AP_MPM_WANT_RECLAIM_CHILD_PROCESSES */
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco/* number of calls to wait_or_timeout between writable probes */
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riescovoid ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret,
8b389272b3312c6d3e3c0aee2e94bca6dbdade50Adrián Riesco if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco rv = apr_proc_wait_all_procs(ret, exitcode, status, APR_NOWAIT, p);
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco if ((ret = reap_children(exitcode, status)) > 0) {
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder apr_sleep(SCOREBOARD_MAINTENANCE_INTERVAL);
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder#endif /* AP_MPM_WANT_WAIT_OR_TIMEOUT */
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riescoint ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status)
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco const char *sigdesc = apr_signal_get_description(signum);
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco /* Child died... if it died due to a fatal error,
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * we should simply bail out. The caller needs to
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * check for bad rc from us and exit, running any
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * appropriate cleanups.
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * If the child died due to a resource shortage,
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco * the parent should limit the rate of forking
6b2e3d60f2e2c230c9637bf0701d7024d289764dAdrián Riesco "Apache is exiting!",
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco "child pid %ld exit signal %s (%d), "
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco "possible coredump in %s",
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián Riesco "child pid %ld exit signal %s (%d)",
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco#endif /* AP_MPM_WANT_PROCESS_CHILD_STATUS */
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) && !defined(WIN32)
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco /* The Nagle algorithm says that we should delay sending partial
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * packets in hopes of getting more data. We don't want to do
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * this; we are not telnet. There are bad interactions between
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * persistent connections and Nagle's algorithm that have very severe
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * performance penalties. (Failing to disable Nagle is not much of a
fe5611d78ea0648e8719cb004a6a26e9a033429aAdrián Riesco * problem with simple HTTP.)
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * In spite of these problems, failure here is not a shooting offense.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco apr_status_t status = apr_setsocketopt(s, APR_TCP_NODELAY, 1);
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco ap_log_error(APLOG_MARK, APLOG_WARNING, status, ap_server_conf,
7fc57d0f02d0fec1192376ccebe2be0224cb9a55Adrián Riesco "setsockopt: (TCP_NODELAY)");
223be434693e8c97e2522ac19155a284b3536035Adrián RiescoAP_DECLARE(uid_t) ap_uname2id(const char *name)
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco "%s: bad user name %s", ap_server_argv0, name);
c1cf2f634a37116ff90e99ca710179a23115cbfbAdrián RiescoAP_DECLARE(gid_t) ap_gname2id(const char *name)
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco "%s: bad group name %s", ap_server_argv0, name);
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riescoint initgroups(const char *name, gid_t basegid)
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco#if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || defined(TPF) || defined(__TANDEM) || defined(OS2) || defined(WIN32) || defined(NETWARE)
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder/* QNX, MPE and BeOS do not appear to support supplementary groups. */
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder#else /* ndef QNX */
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco while (index < NGROUPS_MAX && ((g = getgrent()) != NULL)) {
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco for (names = g->gr_mem; *names != NULL; ++names) {
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder#endif /* def QNX */
27aad79faa0eec8d0e7dda32bca710db95bd2d0aAdrián Riesco#endif /* def NEED_INITGROUPS */
94e112d16f89130a688db8b03ad3224903f5e97eChristian MaederAP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod)
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco rv = apr_file_pipe_create(&((*pod)->pod_in), &((*pod)->pod_out), p);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco apr_sockaddr_info_get(&(*pod)->sa, ap_listeners->bind_addr->hostname,
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco APR_UNSPEC, ap_listeners->bind_addr->port, 0, p);
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(apr_status_t) ap_mpm_pod_check(ap_pod_t *pod)
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián RiescoAP_DECLARE(apr_status_t) ap_mpm_pod_close(ap_pod_t *pod)
357381f0a999099cd2d4c268006df56b47847d68Adrián Riescostatic apr_status_t pod_signal_internal(ap_pod_t *pod)
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder rv = apr_file_write(pod->pod_out, &char_of_death, &one);
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder "write pipe_of_death");
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco/* This function connects to the server, then immediately closes the connection.
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco * This permits the MPM to skip the poll when there is only one listening
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco * socket, because it provides a alternate way to unblock an accept() when
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * the pod is used.
357381f0a999099cd2d4c268006df56b47847d68Adrián Riescostatic apr_status_t dummy_connection(ap_pod_t *pod)
357381f0a999099cd2d4c268006df56b47847d68Adrián Riesco /* create a temporary pool for the socket. pconf stays around too long */
2a5b885d9350ec6dd8bc4992ee91d2f68aa592f4Christian Maeder rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, p);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco "get socket to connect to listener");
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder /* on some platforms (e.g., FreeBSD), the kernel won't accept many
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * queued connections before it starts blocking local connects...
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * we need to keep from blocking too long and instead return an error,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * because the MPM won't want to hold up a graceful restart for a
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, 3 * APR_USEC_PER_SEC);
d021fa76efedeeb63529a82dd1cfd81911f4d03eChristian Maeder ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
71410be62420b321abb02ef1ac2b7f2141b3bc7fAdrián Riesco "set timeout on socket to connect to listener");
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder /* probably some server processes bailed out already and there
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * is nobody around to call accept and clear out the kernel
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * connection queue; usually this is not worth logging
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf,
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco "connect to listener");
94e112d16f89130a688db8b03ad3224903f5e97eChristian MaederAP_DECLARE(apr_status_t) ap_mpm_pod_signal(ap_pod_t *pod)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* we don't write anything to the pod here... we assume
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * that the would-be reader of the pod has another way to
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * see that it is time to die once we wake it up
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * writing lots of things to the pod at once is very
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * problematic... we can fill the kernel pipe buffer and
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * be blocked until somebody consumes some bytes or
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * we hit a timeout... if we hit a timeout we can't just
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * keep trying because maybe we'll never successfully
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * write again... but then maybe we'll leave would-be
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * readers stranded (a number of them could be tied up for
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder * a while serving time-consuming requests)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco for (i = 0; i < num && rv == APR_SUCCESS; i++) {
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#endif /* #ifdef AP_MPM_USES_POD */
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder/* standard mpm configuration handling */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco return "PidFile directive not allowed in <VirtualHost>";
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst char * ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *arg)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maederconst char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *arg)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riescoconst char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder fname = ap_server_root_relative(cmd->pool, arg);
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder return apr_pstrcat(cmd->pool, "Invalid CoreDumpDirectory path ",
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder if ((rv = apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool)) != APR_SUCCESS) {
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riescoapr_lockmech_e ap_accept_lock_mech = APR_LOCK_DEFAULT;
fecce42517d20490f893c4a9dee29b000e1653eaAdrián Riesco "Valid accept mutexes for this platform and MPM are: default"
94e112d16f89130a688db8b03ad3224903f5e97eChristian Maeder#if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM)
94e112d16f89130a688db8b03ad3224903f5e97eChristian MaederAP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *arg)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco /* perchild can't use SysV sems because the permissions on the accept
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * mutex can't be set to allow all processes to use the mutex and
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * at the same time keep all users from being able to dink with the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM)
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; ",