From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1410 Path: news.gmane.org!not-for-mail From: Vincent Danen Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: aborting at stage 1? Date: Sat, 28 Apr 2007 10:57:20 -0600 Message-ID: <20070428165720.GR29193@linsec.ca> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4dIe/AmYstFUGHTF" X-Trace: sea.gmane.org 1177779532 19345 80.91.229.12 (28 Apr 2007 16:58:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 Apr 2007 16:58:52 +0000 (UTC) Cc: supervision@list.skarnet.org To: Jorge Almeida Original-X-From: supervision-return-1647-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Apr 28 18:58:50 2007 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 1HhqG1-0007Nn-DA for gcsg-supervision@gmane.org; Sat, 28 Apr 2007 18:58:49 +0200 Original-Received: (qmail 31652 invoked by uid 76); 28 Apr 2007 16:59:10 -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 31647 invoked from network); 28 Apr 2007 16:59:10 -0000 X-URL: http://linsec.ca/ In-reply-to: Original-Sender: Vincent Danen 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 User-Agent: Mutt/1.5.14 (2007-02-12) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1410 Archived-At: --4dIe/AmYstFUGHTF Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Jorge Almeida [2007-04-28 13:20:21 +0100]: >What happens if some vital init task fails? Suppose that checking the >root filesystem fails. The system should halt, but how to do it? If the >script ends with "init 0" in case the previous steps fail, then some >changes must be made in /etc/runit, according to the man page of >runit-init. But if the root file system is mounted read-only... This has pretty much nothing to do with runit. For instance, my /etc/runit/1 is: #!/bin/execlineb /bin/export PATH "/sbin:/bin:/usr/sbin:/usr/bin" # run the traditional startup services /bin/foreground { /sbin/rc 1 } # create the stopit and reboot files for runit and chmod them appropriately /bin/foreground { /bin/touch /etc/runit/stopit } /bin/foreground { /bin/touch /etc/runit/reboot } /bin/foreground { /bin/chmod 0 /etc/runit/stopit } /bin/foreground { /bin/chmod 0 /etc/runit/reboot } # remove /sbin/runit.old if it's found; that indicates runit was upgraded /bin/foreground { /bin/if { /usr/bin/test -f /sbin/runit.old } /bin/rm -f /= sbin/runit.old } /bin/foreground { /bin/echo } The important thing here is the call to /sbin/rc, which handles all the initial setup, mounting, etc. It's a little too big to paste here, but you can view it here: http://svn.annvix.org/cgi-bin/viewvc.cgi/tools/runit/trunk/init/rc?revision= =3D616&view=3Dmarkup If something fatal happens, it's up to rc to deal with it. It will halt, reboot, drop to a console, etc. before stage 1 can complete if there are problems. Handling that stuff is pretty much outside the scope of runit itself... runit gives you the power to do things, but it's up to you to handle them gracefully. =3D) No different than SysVinit really. FWIW, runit-init is installed as /sbin/init here. --=20 Vincent Danen @ http://linsec.ca/ --4dIe/AmYstFUGHTF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFGM3zwLrxeMv7jCtQRAumxAJ42z8DLB5coK/CuyuMJNegfV2Sa3QCfTyIS kyjATqA4SNzyl1JzmuYGCHo= =T6Qf -----END PGP SIGNATURE----- --4dIe/AmYstFUGHTF--