From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1334 Path: news.gmane.org!not-for-mail From: Charlie Brady Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: graceful restart under runit Date: Fri, 17 Nov 2006 09:53:28 -0500 (EST) Message-ID: References: <20061115114754.GA3759@fly.srk.fer.hr> <20061115160850.GA26987@home.power> <20061116152446.GA4721@fly.srk.fer.hr> <20061117001519.GA652@home.power> <20061117133435.GB2153@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1163775243 22305 80.91.229.2 (17 Nov 2006 14:54:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2006 14:54:03 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-1570-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Nov 17 15:53:59 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1Gl569-0005U4-07 for gcsg-supervision@gmane.org; Fri, 17 Nov 2006 15:53:45 +0100 Original-Received: (qmail 30497 invoked by uid 76); 17 Nov 2006 14:54:06 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 30491 invoked from network); 17 Nov 2006 14:54:05 -0000 X-Spam-Status: No, hits=-1.4 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: charlieb.ott.istop.com X-X-Sender: charlieb@e-smith.charlieb.ott.istop.com Original-To: Alex Efros In-Reply-To: <20061117133435.GB2153@home.power> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1334 Archived-At: On Fri, 17 Nov 2006, Alex Efros wrote: > On Thu, Nov 16, 2006 at 07:48:55PM -0500, Paul Jarc wrote: >>> Another option - you can ask runsv to 'x' (Exit) instead of 't' (Term). >>> In this case runsv will send SIGTERM to your process, which can process it >>> by just closing listening socket, waiting until existing connection finish >>> and then exit. >>> After few (up to 5) seconds runsv will be started again by runsvdir, and >>> so start second process of that server (which will open listening socket >>> again). >> This seems worse than t. In either case, new connections are refused >> while the old process cleans up its current connections, but with x, >> new connections are also refused for up to 5 seconds more. > > If old server continue accepting new connections for 5 seconds after > receiving SIGTERM this solve 'connection refused' issue. (If new server > will be started after 1 second, for example, then in next 4 seconds both > server will have open listening socket and some connections will be > accepted by first server and some by second AFAIK - I don't see something > really wrong with this.) The new server will get an "Address in use" error when it attempts to open the socket, if it is still in use by the old server. It will likely then die, and you will have to wait again for runsv to start a new one. You will still have a period of time when connections will not be accepted. Gerrit, tcpsvd man page doesn't mention how tcpsvd responds to signals, but I would guess it doesn't go into the background and die without terminating its children, in response to SIGUSR1. Would you consider adding that behaviour?