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

From: Jan Pobrislo <>
Date: Thu, 7 Aug 2014 12:07:23 +0200

On Sat, 2 Aug 2014 17:01:15 -0700
James Powell <> wrote:

> Over at our project we imported a utility from VoidLinux that handles
> the halt functions and a special shutdown script also. I'm curious if
> we could import and adapt it officially into Runit if only for
> completionary purposes.

Shutdown *scripts* go into stage 3 and you can use them right now with

This stage 4 - hand-off is only necessary for things that need
to run in pid1, for example see hddown.c in sysvinit sources. That part
of program needs to load everything necessary into memory so there is
nothing accessing the storage anymore and does HDIO_DRIVE_CMD ioctl to
spindown the drives - to make sure all the write caches were flushed
just before it halts the machine.

On the other hand, it seems that shutting down from initrd is the
default way now on systemd/dracut systems:
and I guess it makes sense nowadays with enough space on tmpfs to do
device shutdowns from there as you don't have to worry that you'll cut
the branch you're sitting on. And such hand-off would be necessary to
get pid1 out of the former root.
Received on Thu Aug 07 2014 - 10:07:23 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC