From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1441 Path: news.gmane.org!not-for-mail From: Gerrit Pape Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: aborting at stage 1? Date: Tue, 19 Jun 2007 18:32:02 +0000 Message-ID: <20070619183202.24886.qmail@f2f18f9094771c.315fe32.mid.smarden.org> References: <20070428165720.GR29193@linsec.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182277904 18445 80.91.229.12 (19 Jun 2007 18:31:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2007 18:31:44 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1678-gcsg-supervision=m.gmane.org@list.skarnet.org Tue Jun 19 20:31:43 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 1I0iUR-0002SR-1b for gcsg-supervision@gmane.org; Tue, 19 Jun 2007 20:31:43 +0200 Original-Received: (qmail 27043 invoked by uid 76); 19 Jun 2007 18:32:04 -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 27038 invoked from network); 19 Jun 2007 18:32:04 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1441 Archived-At: On Sat, Apr 28, 2007 at 08:34:23PM +0100, Jorge Almeida wrote: > On Sat, 28 Apr 2007, Vincent Danen wrote: > >* 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: > > > Thank you for your reply, but I'm kind of lost here. The system I'm > trying to setup is LFS. I don't want to use general boot scripts, I'm > trying to keep the boot scripts (i.e., stages 1 and 3 scripts) simple > and customized to my system (sacrifying generality). I noticed that the > rc script in the link you provided uses /sbin/halt. In my Gentoo system, > /sbin/halt belongs to the sysvinit package, so I suppose it will not be > available in a sysvinit-free, pure runit, system. Is this correct? If > so, the point is how to halt the system during stage 1 when something > goes wrong and the root filesystem is not writable. From what I > understood of the runit man pages, the only way to halt the computer > when something goes wrong during stage 1 is to have the script > /etc/runit/1 to issue "init 0". This will jump over stage 2 but will go > to stage 3, which will need the root filesystem to be writable. Hi, if something goes wrong in stage 1, the /etc/runit/1 script should exit 100. runit will then skip stage 2, and enter stage 3, see runit(8). Possibly some things in stage 3 won't work if the root fs is mounted read-only, but finally /etc/runit/3 will exit, and runit will either halt or reboot after looking at /etc/runit/reboot. For read-only filesystems, runit supports /etc/runit/reboot being a symlink, even a dangling one, which can point into a ramdisk mount point. This applies to all files/directories the runit programs need write access to BTW, if not, I'd consider it as a bug. HTH, Gerrit.