supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Vincent Danen <vdanen@linsec.ca>
To: Jorge Almeida <jalmeida@math.ist.utl.pt>
Cc: supervision@list.skarnet.org
Subject: Re: aborting at stage 1?
Date: Sat, 28 Apr 2007 10:57:20 -0600	[thread overview]
Message-ID: <20070428165720.GR29193@linsec.ca> (raw)
In-Reply-To: <Pine.LNX.4.64.0704281311070.28059@jmaa.math.ist.utl.pt>

[-- Attachment #1: Type: text/plain, Size: 1873 bytes --]

* Jorge Almeida <jalmeida@math.ist.utl.pt> [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=616&view=markup

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.  =)  No different than SysVinit really.

FWIW, runit-init is installed as /sbin/init here.

-- 
Vincent Danen @ http://linsec.ca/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

  reply	other threads:[~2007-04-28 16:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 12:20 Jorge Almeida
2007-04-28 16:57 ` Vincent Danen [this message]
2007-04-28 19:34   ` Jorge Almeida
2007-04-29  0:22     ` Mike Buland
2007-04-29 23:12       ` Vincent Danen
2007-04-30 10:06         ` Jorge Almeida
2007-06-19 18:32     ` Gerrit Pape
2007-06-19 19:02       ` Jorge Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070428165720.GR29193@linsec.ca \
    --to=vdanen@linsec.ca \
    --cc=jalmeida@math.ist.utl.pt \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).