From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1628 Path: news.gmane.org!not-for-mail From: Vincent Danen Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: using runit as init Date: Sun, 13 Jan 2008 20:50:47 -0700 Message-ID: <20080114035047.GP41886@linsec.ca> References: <200801032151.21524.list-supervision@augensalat.de> <200801110858.33026.list-supervision@augensalat.de> <200801110730.09851.mike@geekgene.com> <200801121118.53450.list-supervision@augensalat.de> <50F2BE60A0EF6D478B1BCC633DEC28CC01F70A@server.home.internal> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary=iKRNNmbp+8055uZ4 X-Trace: ger.gmane.org 1200282738 984 80.91.229.12 (14 Jan 2008 03:52:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2008 03:52:18 +0000 (UTC) Cc: Bernhard Graf , supervision@list.skarnet.org To: rehan khan Original-X-From: supervision-return-1863-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Jan 14 04:52:39 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 1JEGND-00011w-Lw for gcsg-supervision@gmane.org; Mon, 14 Jan 2008 04:52:31 +0100 Original-Received: (qmail 16799 invoked by uid 76); 14 Jan 2008 03:52:13 -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 16787 invoked from network); 14 Jan 2008 03:52:11 -0000 X-URL: http://linsec.ca/ In-reply-to: <50F2BE60A0EF6D478B1BCC633DEC28CC01F70A@server.home.internal> Content-disposition: inline X-PGP-Key: http://linsec.ca/vdanen.asc X-PGP-Key-ID: 0xFEE30AD4 X-PGP-Key-Fingerprint: 7F6C A60C 06C2 4811 FA1C A2BC 2EBC 5E32 FEE3 0AD4 X-Delivery-Agent: TMDA/1.1.10 (Killyloch) X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: vdanen@annvix.org X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on hades.annvix.ca X-SA-Exim-Version: 4.2.1 (built Tue, 18 Dec 2007 12:19:09 -0700) X-SA-Exim-Scanned: Yes (on hades.annvix.org) User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=unavailable version=3.2.3 X-Spam-Level: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1628 Archived-At: --iKRNNmbp+8055uZ4 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * rehan khan [2008-01-13 10:35:40 -0000]: >> >> Fortunately, I don't have one run script that's more than 4 or 5 >> >> lines, and most of that is whitespace :) >> > >> >Lucky you. >> >You don't run mysql, do you? >>=20 >> I do, but it could be done in less than 5 lines. My current runscript >> for mysql is 29 lines, but a lot of that is error checking and settting >> variables, none of which would be required for a single person who knows >> what he's doing. >>=20 >> mysqld is no more complex than anything else. >>=20 > >I think this is one of the problems with why runit has had slower takeup a= nd initng and upstart are stealing it's thunder, in the major distro arena = - no offence to the fine annvix distro. Much of the documentation available= on the net provide these highly abreviated init scripts which might only a= pply to linux (runit is multi OS). This is not actually what is required in= a general purpose OS. The scripts need to be complete in the sense that th= ey can cope with most things thrown at them including incomplete configurat= ions, initial startups etc. In fact when one gets to mad java apps like Tom= cat and Hsqldb the scripts become nightmares as they have to cope with so m= any OS's and java versions and such like. > >mysqld is an interesting example. On a freshly installed OS nothing is ini= tialised for mysql. How would one cope with this situation? The fedora scri= pts ask the user for input and setup initial databases. Depends on the OS. For annvix, the default database is setup when the rpm is installed. I believe most distros do something similar... granted, I don't use much beyond annvix and mandriva, but I can't imagine anyone thinking that an initscript is a good place to be asking for user configuration. Initscripts should be non-interactive... it certainly isn't the right place to be asking users for configuration info. >Runit does not have any in-built mechanism for this this scenario and it n= eeds to be built into the supporting scripts. Runit also does not have any = mechanism to signal the system that user input is required and that all oth= er services should not write to the console while this is happening. Runit = also does not have a mechanism to signal that a particular services needs t= o have exclusive access to the system (useful if one wants to migrate the r= c.sysinit script to a bunch of runit services). The scripts built around ru= nit need to take care of these situations. At the end of startup there need= s to be some kind of indication that services have failed/succeeded for som= e reason otherwise they may go un-noticed. This could be useful, granted, but doesn't necessarily need to be done by runit. A simple script called after everything gets started could check to see what is down and should be up, then report on those. with annvix, we use a frontend to sv called srv, and srv --list will tell you what is up, down, should be up, when it changed state, etc. But I don't think runit needs to change to allow people to execute configuration during service startup becuase I think these services should be configured before they're told to start. Distros that use initscripts to setup services themselves are, imho, bastardizing what initscripts were designed for in a very wrong way. >In some ways I think runsvdir could use some additional functionality and = I am thinking of re-implementing it in python. Runsvdir does in effect supe= rvise all the runsv processes (when it is used) and would be a good place t= o co-ordinate this kind of activity (process signalling, holding a dependan= cy database). I probably need to do this anyway to get Linux Standards Base= compliance. > >It would be nice to see a collection of multi-OS (linux, bsd etc) init scr= ipts somewhere out there. Perhaps if someone could help me out with the cvs= /svn setup on the fedorafastboot project we can get a general script reposi= tory setup? The annvix svn is open and we have runscripts for a number of services that can easily be cherrypicked by anyone interested. http://svn.annvix.org/. --=20 Vincent Danen @ http://linsec.ca/ --iKRNNmbp+8055uZ4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkeK3BcACgkQLrxeMv7jCtRptACfWkI6PY8J0cxvDTCeklr4SQov kzoAoJvlDAr/P+pUTKvnOOnO9l498wt7 =hDYs -----END PGP SIGNATURE----- --iKRNNmbp+8055uZ4--