From ff781adeb26caca82a717d7f1dd83c4ad94b5165 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Wed, 17 Jun 2015 18:33:06 +0000
Subject: Fix some bugs, add some doc
---
doc/s6-linux-init-maker.html | 63 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 55 insertions(+), 8 deletions(-)
(limited to 'doc/s6-linux-init-maker.html')
diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html
index cdf617e..530cd41 100644
--- a/doc/s6-linux-init-maker.html
+++ b/doc/s6-linux-init-maker.html
@@ -49,6 +49,7 @@ machine - else the scripts will crash.
[ -u log_user ] \
[ -g early_getty ] \
[ -2 stage2 ] \
+ [ -r ] \
[ -3 stage3 ] \
[ -p initial_path ] \
[ -m initial_umask ] \
@@ -74,7 +75,7 @@ declared as basedir. Be careful: it contains fifos, files with
precise uid/gid permissions, and files with non-standard access rights,
so be sure to copy it verbatim. The
s6-hiercopy
-tool can do it, as well as the GNU or busybox cp -a command.
+tool can do it, as well as the GNU or busybox cp -a or mv commands.
@@ -133,11 +134,10 @@ system. When stage2 is executed, the machine state is as follows:
- stage2's working directory is / and its stdin
-is /dev/null. stage2's
-stdout and stderr both point to the pipe to the catch-all logger, so
-unless redirected, stage2's output will be logged into the
-tmpfsdir/uncaught-logs directory.
- - The system has a valid device directory mounted on /dev.
+is /dev/null. Its
+stdout and stderr both point either to /dev/console or to the pipe
+to the catch-all logger, depending on the -r option.
+ - The system has a valid device directory mounted on /dev.
- Depending on the kernel boot command line, the root filesystem
may be in read-only mode.
- There is a tmpfs available for root only in tmpfsdir.
@@ -227,6 +227,14 @@ the location of the stage 2 script that will be run when the
system has an operational supervision tree. It must be absolute. Default is
/etc/rc.init.
+ - -r : redirect. By default, stage2 is
+run with stdout and stderr pointing to /dev/console, so that
+users can see what init scripts print. However, it may conflict
+with an early getty, or be undesirable for other reasons. The
+-r option redirects stage2's stdout and stderr
+to the catch-all logger, so the output will be made available
+in the tmpfsdir/uncaught-logs directory.
+
- -3 stage3 : stage3 is
the location of the stage 3 script that will be run at the end of
the machine lifetime, when s6-svscan is told to terminate.
@@ -235,8 +243,14 @@ It must be absolute. Default is
- -p initial_path : the value to
set the PATH environment variable to, for all the starting processes.
-This will be done as early as possible in stage1. Default is
-the value that has been compiled in
+This will be done as early as possible in stage1. It is
+absolutely necessary for
+execline,
+s6,
+s6-portable-utils and
+s6-linux-utils
+binaries to be accessible via initial_path, else the machine
+will not boot. Default is the value that has been compiled in
skalibs via the
--with-default-path configure option, i.e. by default
/usr/bin:/bin.
@@ -272,5 +286,38 @@ The TZ variable, for instance, is a good candidate to be set in
the global environment.
+ Notes
+
+
+ The difficult parts of
+running
+s6-svscan as process 1 are:
+
+
+
+ - The fact that the supervision tree requires writable directories,
+so in order to accommodate read-only root filesystems, there needs to
+be a tmpfs mounted before s6-svscan is run.
+ - The catch-22 coming for the need to redirect the supervision
+tree's output away from /dev/console (which is fine for a
+first process invocation but impractical for log management of a
+whole process tree) and into a logger that is itself managed by the
+supervision tree it's reading data from.
+
+
+
+ The main benefit of s6-linux-init-maker is that it automates those
+parts. This means that it has been designed for real hardware
+where the above issues apply.
+ If you are building an init system for a
+virtual machine, a container, or anything similar that does not
+have the /dev/console issue or the read-only rootfs issue,
+you will probably not reap much benefit from using s6-linux-init-maker:
+you could probably invoke
+s6-svscan
+directly as your process 1, or build a script by hand, which
+would result in a simpler init with less dependencies.
+
+