From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1330 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: graceful restart under runit Date: Fri, 17 Nov 2006 02:15:19 +0200 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20061117001519.GA652@home.power> References: <20061115114754.GA3759@fly.srk.fer.hr> <20061115160850.GA26987@home.power> <20061116152446.GA4721@fly.srk.fer.hr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1163722530 31453 80.91.229.2 (17 Nov 2006 00:15:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2006 00:15:30 +0000 (UTC) Cc: Dra?en Ka?ar Original-X-From: supervision-return-1566-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Nov 17 01:15:26 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 1GkrO6-0006uF-Nh for gcsg-supervision@gmane.org; Fri, 17 Nov 2006 01:15:22 +0100 Original-Received: (qmail 21456 invoked by uid 76); 17 Nov 2006 00:15:43 -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 21450 invoked from network); 17 Nov 2006 00:15:43 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org, Dra?en Ka?ar Content-Disposition: inline In-Reply-To: <20061116152446.GA4721@fly.srk.fer.hr> User-Agent: Mutt/1.5.13 (2006-08-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1330 Archived-At: Hi! On Thu, Nov 16, 2006 at 04:24:46PM +0100, Dra?en Ka?ar wrote: > However, there are multithreaded monsters which can't do that. fork() :-/ 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). Probably you can even convert 't' to 'x' using file ./control/t - to be able to use 't' instead of 'x' for restarting this service just as for any other services. P.S. Of course, better solution is not develop multithreaded monsters :) or split that monster into two processes - one for accepting connections and second for processing these connections (that architecture also much better scale because you can run multiple "second" processes, each multithreaded and process many connections - this proven to have better performance compared to single multithreaded process or many singlethreaded processes). -- WBR, Alex.