From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1329 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?Q?Dra=BEen_Ka=E8ar?= Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: graceful restart under runit Date: Thu, 16 Nov 2006 16:24:46 +0100 Message-ID: <20061116152446.GA4721@fly.srk.fer.hr> References: <20061115114754.GA3759@fly.srk.fer.hr> <20061115160850.GA26987@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1163690732 28094 80.91.229.2 (16 Nov 2006 15:25:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Nov 2006 15:25:32 +0000 (UTC) Original-X-From: supervision-return-1565-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Nov 16 16:25:27 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 1Gkj6o-0003El-QE for gcsg-supervision@gmane.org; Thu, 16 Nov 2006 16:24:58 +0100 Original-Received: (qmail 28553 invoked by uid 76); 16 Nov 2006 15:25:19 -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 28547 invoked from network); 16 Nov 2006 15:25:19 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: =?iso-8859-2?Q?Dra=BEen_Ka=E8ar?= , supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <20061115160850.GA26987@home.power> X-Face: 'UIE}WabGB0+U>p-#(hp<_+AD2{H],=qR*jHfm$/e]l0(kU3oOYc5lqG6gg>[\h^IOc{'siD6#!T&loIShgmYHz3#+*D38:|`~\BE,(W~Ol9BDfDwk'lKJ;Z{sY8E9(ME.E]'wvNO`$n#,;9Z`tOFcW/nHZq!BOSrM>V?C<5DTw=<${c{M2V+|)0jSUl&!+8%8nIBF(u:E>SZWM^e User-Agent: Mutt/1.4i X-Attribution: Dave X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (fly.srk.fer.hr [127.0.0.1]); Thu, 16 Nov 2006 16:24:52 +0100 (MET) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1329 Archived-At: Alex Efros wrote: > On Wed, Nov 15, 2006 at 12:47:54PM +0100, Dra?en Ka?ar wrote: > > Say I have a TCP server which listens on incoming connections on some TCP > > port. Occasionaly I'd like to install and run a new version of the server > > executable. Server source is under my control, for all intents and > > purposes. > [...] > > Is there a way to get around this? > > Probably you can just fork() after receiving SIGUSR1 and exit from parent > leaving child to process existing connection. Servers which use process per connection do something like that already (the parent process signals the children, exits and leaves them to finish sessions and then they exit too). However, there are multithreaded monsters which can't do that. fork() replicates just the calling thread[1], so it's not an option and exit() will terminate all threads (ie. all sessions). [1] It's possible to replicate all threads on Solaris, but that's too unportable for my purposes. Besides, calling fork() from an MT process usually uncovers bugs in various libraries which aren't prepared to deal with that. -- .-. .-. Yes, I am an agent of Satan, but my duties are largely (_ \ / _) ceremonial. | | dave@fly.srk.fer.hr