mpm_common.c revision 7c7372abe2484e7fcf81937b93496d1246e5b816
2N/A/* ==================================================================== 2N/A * The Apache Software License, Version 1.1 2N/A * Copyright (c) 2000 The Apache Software Foundation. All rights 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * 2. Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in 2N/A * the documentation and/or other materials provided with the 2N/A * 3. The end-user documentation included with the redistribution, 2N/A * if any, must include the following acknowledgment: 2790N/A * "This product includes software developed by the 5337N/A * Alternately, this acknowledgment may appear in the software itself, 2N/A * if and wherever such third-party acknowledgments normally appear. 2N/A * 4. The names "Apache" and "Apache Software Foundation" must 2N/A * not be used to endorse or promote products derived from this 2N/A * software without prior written permission. For written 2N/A * permission, please contact apache@apache.org. 2N/A * 5. Products derived from this software may not be called "Apache", 2N/A * nor may "Apache" appear in their name, without prior written 2N/A * permission of the Apache Software Foundation. 59N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 2N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 2N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2N/A * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26N/A * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1470N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 38N/A * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1470N/A * ==================================================================== 181N/A * This software consists of voluntary contributions made by many 26N/A * individuals on behalf of the Apache Software Foundation. For more 4811N/A * information on the Apache Software Foundation, please see 3739N/A * Portions of this software are based upon public domain software 3739N/A * originally written at the National Center for Supercomputing Applications, 3739N/A * University of Illinois, Urbana-Champaign. 3739N/A/* The purpose of this file is to store the code that MOST mpm's will need 3739N/A * this does not mean a function only goes into this file if every MPM needs 3739N/A * it. It means that if a function is needed by more than one MPM, and 3817N/A * future maintenance would be served by making the code common, then the 26N/A * This is going in src/main because it is not platform specific, it is 26N/A * specific to multi-process servers, but NOT to Unix. Which is why it 4437N/A /* don't want to hold up progress any more than 26N/A * necessary, but we need to allow children a few moments to exit. 26N/A * Set delay with an exponential backoff. 26N/A /* now see who is done */ 5349N/A /* ok, now it's being annoying */ 2236N/A "child process %ld still did not exit, sending a SIGTERM",
26N/A case 8:
/* 6 sec */ 26N/A /* die child scum */ 4353N/A "child process %ld still did not exit, sending a SIGKILL",
59N/A /* sending a SIGKILL kills the entire team on BeOS, and as 12N/A * httpd thread is part of that team it removes any chance 30N/A * of ever doing a restart. To counter this I'm changing to 4811N/A * use a kinder, gentler way of killing a specific thread 4811N/A * that is just as effective. 1256N/A /* gave it our best shot, but alas... If this really 1256N/A * is a child we are trying to kill and it really hasn't 1256N/A * exited, we will likely fail to bind to the port 1256N/A "could not make child process %ld exit, " 1256N/A "attempting to continue anyway", (
long)
pid);
1256N/A /* nothing left to wait for */ 3109N/A#
endif /* NEED_RECLAIM_CHILD_PROCESSES */ 3109N/A/* number of calls to wait_or_timeout between writable probes */ 26N/A /* Child died... if it died due to a fatal error, 30N/A * we should simply bail out. 64N/A "Apache is exiting!",
2818N/A "child pid %ld exit signal %s (%d), " 1256N/A "child pid %ld exit signal %s (%d)",
1256N/A /* The Nagle algorithm says that we should delay sending partial 1256N/A * packets in hopes of getting more data. We don't want to do 2818N/A * this; we are not telnet. There are bad interactions between 3449N/A * persistent connections and Nagle's algorithm that have very severe 3449N/A * performance penalties. (Failing to disable Nagle is not much of a 3449N/A * problem with simple HTTP.) 3449N/A * In spite of these problems, failure here is not a shooting offense. 1256N/A "setsockopt: (TCP_NODELAY)");
3109N/A/* QNX, MPE and BeOS do not appear to support supplementary groups. */ 3109N/A#
endif /* def NEED_INITGROUPS */