summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-10-13 16:05:05 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-10-13 16:05:05 +0000
commite00d2c4d88c90ccc6d091bde07d412936f8886d3 (patch)
tree21ccec11c0b36dab9f3284a311193821b3dfc700 /doc
parent49352128c1a9dfc15a4bd29530d68a4b241909e6 (diff)
downloads6-linux-init-e00d2c4d88c90ccc6d091bde07d412936f8886d3.tar.xz
- added stage2_finish support
- s6 dep bumped to 2.2.2.0
Diffstat (limited to 'doc')
-rw-r--r--doc/index.html2
-rw-r--r--doc/s6-linux-init-maker.html38
-rw-r--r--doc/upgrade.html3
3 files changed, 41 insertions, 2 deletions
diff --git a/doc/index.html b/doc/index.html
index 260b286..f328f44 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -58,7 +58,7 @@ a small FAQ.
<li> <a href="http://skarnet.org/software/s6-linux-utils/">s6-linux-utils</a> version
2.0.2.3 or later </li>
<li> <a href="http://skarnet.org/software/s6/">s6</a> version
-2.2.1.1 or later </li>
+2.2.2.0 or later </li>
</ul>
<p>
diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html
index 530cd41..95c0101 100644
--- a/doc/s6-linux-init-maker.html
+++ b/doc/s6-linux-init-maker.html
@@ -50,6 +50,7 @@ machine</em> - else the scripts will crash.
[ -g <em>early_getty</em> ] \
[ -2 <em>stage2</em> ] \
[ -r ] \
+ [ -Z ] <em>stage2_finish</em> \
[ -3 <em>stage3</em> ] \
[ -p <em>initial_path</em> ] \
[ -m <em>initial_umask</em> ] \
@@ -186,6 +187,37 @@ do not hold any file descriptor to a filesystem that would need to be
unmounted. </li>
</ul>
+<p>
+ When s6-svscan receives a signal such as SIGINT, typically sent by the
+Ctrl-Alt-Del key combination or a <tt>reboot</tt> or <tt>poweroff</tt>
+command, it will run the corresponding script in
+<tt><em>tmpfsdir</em>/service/.s6-svscan</tt>, which will first run
+<em>stage2_finish</em>, then send an exit command to s6-svscan as
+described above. This is useful if some commands need to be run before
+s6-svscan executes into <em>stage3</em>: for instance, if the machine
+state is maintained by a service manager such as
+<a href="http://skarnet.org/software/s6-rc/">s6-rc</a>, all the
+services can be turned off in <em>stage2_finish</em> while s6-svscan
+is still alive, and then the last steps of the shutdown procedure can
+be performed in <em>stage3</em>.
+</p>
+
+<p>
+ Generally speaking, <em>stage2_finish</em> should undo what
+<em>stage2</em> has done at boot time, so <em>stage3</em> has very
+little work to do.
+</p>
+
+<p>
+ The <tt>examples/</tt> subdirectory of the s6-linux-init package
+contains an example of <tt>/etc/rc.init</tt>, <tt>/etc/rc.tini</tt>
+and <tt>/etc/rc.shutdown</tt> scripts, suitable for
+<em>stage2</em>, <em>stage2_finish</em> and <em>stage3</em>
+respectively. Those scripts can practically be used as is if the machine
+is managed by the <a href="http://skarnet.org/software/s6-rc/">s6-rc</a>
+service manager.
+</p>
+
<h2> s6-linux-init-maker options </h2>
<ul>
@@ -235,6 +267,12 @@ with an early getty, or be undesirable for other reasons. The
to the catch-all logger, so the output will be made available
in the <tt><em>tmpfsdir</em>/uncaught-logs</tt> directory. </li> <p />
+ <li> <tt>-Z</tt>&nbsp;<em>stage2_finish</em>&nbsp;:
+<em>stage2_finish</em> is the location of the script that will be
+run when s6-svscan receives a signal that tells it to stop the
+machine, before it executes into <em>stage3</em>. It must be
+absolute. Default is <strong><tt>/etc/rc.tini</tt></strong>. </li> <p />
+
<li> <tt>-3</tt>&nbsp;<em>stage3</em>&nbsp;: <em>stage3</em> 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.
diff --git a/doc/upgrade.html b/doc/upgrade.html
index a5787ed..3118cbf 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -30,7 +30,8 @@ dependency bumped to 2.0.5.3. </li>
<li> <a href="http://skarnet.org/software/s6-linux-utils/">s6-linux-utils</a>
dependency bumped to 2.0.2.3. </li>
<li> <a href="http://skarnet.org/software/s6/">s6</a>
-dependency bumped to 2.2.1.1. </li>
+dependency bumped to 2.2.2.0. </li>
+ <li> <em>stage2_finish</em> support added. </li>
</ul>
<h2> in 0.0.1.3 </h2>