From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1604 Path: news.gmane.org!not-for-mail From: KORN Andras Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: using runit as init Date: Thu, 10 Jan 2008 00:35:04 +0100 Message-ID: <20080109233504.GW19934@utopia.intra.guy> References: <200801032151.21524.list-supervision@augensalat.de> <200801082328.06568.list-supervision@augensalat.de> <20080109020503.GX41886@linsec.ca> <200801100006.54381.list-supervision@augensalat.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Trace: ger.gmane.org 1199921707 31535 80.91.229.12 (9 Jan 2008 23:35:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jan 2008 23:35:07 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1839-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Jan 10 00:35:28 2008 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1JCkSG-0000iO-Mr for gcsg-supervision@gmane.org; Thu, 10 Jan 2008 00:35:28 +0100 Original-Received: (qmail 27196 invoked by uid 76); 9 Jan 2008 23:35:12 -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 27191 invoked from network); 9 Jan 2008 23:35:12 -0000 Content-Disposition: inline In-Reply-To: <200801100006.54381.list-supervision@augensalat.de> User-Agent: Mutt/1.5.16 (2007-06-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1604 Archived-At: On Thu, Jan 10, 2008 at 12:06:54AM +0100, Bernhard Graf wrote: > I would like to just link init scripts into runsvdir's directory, so > they are started automatically. But as we know init scripts terminate > and runsv would restart them immediately. I'd like to have a > non-respawn mode for runsv. So have your script remove the symlink to the directory that contains it from /service before it exits (or in ./finish). > Having all this it would be simple to convert the links in directories > /etc/init.d/rc[0123456S].d into correspondig links > in /etc/runit/runsvdir/[0123456S] and replace init-daemon-install-tools > like chkconfig or insserv by runit-compliant versions. > So no need to change all daemons with those init.d start-stop scripts. > Even those that are installed later would continue to work. I think this is a misguided attempt to provide "uniformity". Traditional initscript are quite horrible; I invite you to read, for example, Ubuntu's apache2 initscript and be appalled at all the unnecessary complexity and race conditions galore. One of the chief motivations for switching away from an init-like system, where services daemonise, to a runit-like system where they are supervised by their parent process is, or at least should be, the desire to get away from those race conditions and the fragility of it all. To get away from pid lotto. What reason would justify importing that mess into this clean new service supervision and system startup scheme? FWIW, services with initscripts you haven't converted to runit services naturally continue to work. You can just do "/etc/init.d/foo start" even if your process 1 is runit. Runit can even start these services automatically. You can even arrange for them to be started and stopped on runlevel changes (runsvchdir's) with the help of some kludgery (e.g. like the one I suggested above). The real solution, however, is of course to convert the messy and complex initscripts into neat and clean run scripts. You only need to do this once per daemon, not once per daemon per computer. Chances are someone already has a run script for your daemon, so you needn't really do anything at all. Why would you want to keep initscripts around to the extent of creating one-shot runit services? Maybe there is a different solution. Andras -- Andras Korn QOTD: If at first you don't succeed, you must be a programmer.