Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 91863 invoked by uid 500); 2 Aug 2003 01:24:20 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 91850 invoked from network); 2 Aug 2003 01:24:19 -0000 Received: from c-67-160-219-187.client.comcast.net (HELO booch.minidns.net) (67.160.219.187) by daedalus.apache.org with SMTP; 2 Aug 2003 01:24:19 -0000 Received: from [127.0.0.1] (helo=dessent.net) by booch.minidns.net with esmtp (Exim 4.20) id HIYX8S-0002D0-A4 for users@httpd.apache.org; Fri, 01 Aug 2003 18:24:28 -0700 Message-ID: <3F2B12CC.88DDD447@dessent.net> Date: Fri, 01 Aug 2003 18:24:28 -0700 From: Brian Dessent Organization: My own little world... X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,en-US MIME-Version: 1.0 To: users@httpd.apache.org References: <20030801172019.7fd3306d.greg@intouch.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: [users@httpd] Shutting down Apache very gracefully Greg Webster wrote: > > Hi all, > > I know this has been asked before in a number of places (available on > Google), but it seems to have never been resolved. > > We've got a number of Apache webservers sitting behind a load-balancing > controller. Occasionally we have to take one of the webservers down to > make changes, and once in a while taking a webserver down causes broken > connections for our users or our automated webserver-checkers. > > What I want is a way to shut down Apache by killing idle child processes > until all of them are dead and not accepting new requests. Then Apache > can die without causing any broken connections. We've tried all the > standard methods and the broken connections still occur. > > Is there any 'best' way, or some way to do what I have listed above? I have no idea if this would work but: You might be able to exploit the SIGUSR1 (graceful restart) behavior. Normally, sending SIGUSR1 to the parent causes it to kill all idle children, and signal to all active children to exit after servicing the current request. The parent then goes through a restart cycle, including rereading the httpd.conf. So, if you were to somehow temporarily force a syntax error in httpd.conf, then send SIGUSR1, you would kill the parent and any idle children, and they would not respawn because of the config error. The remaining children would exit after finishing the request they are actively serving. Note that you couldn't do this with 'apachectl graceful' since that runs a config check first to make sure that the above scenario specifically doesn't happen (since you usually want your server to keep running, not die.) You would have to do something like "kill -SIGUSR1 `cat /var/run/httpd.pid`". -- I have no idea if that would work or not and it sure is ugly, but if there really is no other solution out there it might work. Brian --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org