RE: [PATCH] Implement stage 4 (execve handoff)

2014-08-01 Thread James Powell
Might be good for a bootdisk scenario in some ways as FINNIX does. However 
outside that, I would have only speculation for a real time system. Still 
intriguing to say the least. 

 Date: Fri, 1 Aug 2014 10:20:10 +
 From: p...@smarden.org
 To: supervision@list.skarnet.org
 Subject: Re: [PATCH] Implement stage 4 (execve handoff)
 
 On Tue, Jul 29, 2014 at 12:01:36PM -0700, Ryan Finnie wrote:
  This patch adds stage 4, an optional stage which is run after stage 3.
  If /etc/runit/4 is found and executable, runit will execve() into it,
  giving it control of PID 1.  Finnix (http://www.finnix.org/) uses runit
  as its init system, and uses this patch as a way to pivot root back into
  a ramdisk upon shutdown, so it may cleanly umount the union mount which
  houses runit.
 
 Hi Ryan, I'm not sure how interesting this is for general use.  It's
 the first time I hear about the need for a stage 4.
 
 And actually I wouldn't call it so, because runit no longer runs but got
 replaced.  Finally, when considering an updated version, documentation
 is missing ;).
 
 Regards, Gerrit.
  

Re: [PATCH] Implement stage 4 (execve handoff)

2014-08-01 Thread Ryan Finnie
On 08/01/2014 03:20 AM, Gerrit Pape wrote:
 On Tue, Jul 29, 2014 at 12:01:36PM -0700, Ryan Finnie wrote:
 This patch adds stage 4, an optional stage which is run after stage 3.
 If /etc/runit/4 is found and executable, runit will execve() into it,
 giving it control of PID 1.  Finnix (http://www.finnix.org/) uses runit
 as its init system, and uses this patch as a way to pivot root back into
 a ramdisk upon shutdown, so it may cleanly umount the union mount which
 houses runit.
 
 Hi Ryan, I'm not sure how interesting this is for general use.  It's
 the first time I hear about the need for a stage 4.
 
 And actually I wouldn't call it so, because runit no longer runs but got
 replaced.  Finally, when considering an updated version, documentation
 is missing ;).

I admit, even I can't think of a use for it outside of LiveCDs such as
Finnix.  On a normal system, you're usually fine with remounting the
root filesystem read-only, syncing, and cutting power, all of which can
be done in Stage 3.  With a LiveCD, the root filesystem is usually a
union mount between a ramdisk and a CDROM, so I wanted a PID 1 handoff
to pivot_root into ramdisk, so I could umount the union and the CD so
the CD could be cleanly ejected.  (There are other ways around this
which other LiveCDs use, but they often employ tricks which don't always
work.)  Still, it's a small functionality patch and is backwards
compatible with all current usage.

I maintain this patch in a Finnix-specific port of the Debian package,
and only thought about upstreaming it because I need to rebase it after
each Debian package update.  So far this has only happened once, last
week (thanks BTW for including my diet/PowerPC fix), so it's not a big
inconvenience.

If you don't want to include this upstream, no worries.  If you do, I'd
be happy to write documentation updates to cover it.

RF



signature.asc
Description: OpenPGP digital signature