1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en" />
<title>s6-rc: the s6-rc-init program</title>
<meta name="Description" content="s6-rc: the s6-rc-init program" />
<meta name="Keywords" content="s6-rc command s6-rc-init rc init dependency state management services" />
<!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
</head>
<body>
<p>
<a href="index.html">s6-rc</a><br />
<a href="http://skarnet.org/software/">Software</a><br />
<a href="http://skarnet.org/">skarnet.org</a>
</p>
<h1> The s6-rc-init program </h1>
<p>
s6-rc-init is an initialization tool for the s6-rc
system. It must be run as root, at boot time, prior to any
invocation of the
<a href="s6-rc.html">s6-rc</a> binary.
</p>
<h2> Interface </h2>
<pre>
s6-rc-init [ -c <em>compiled</em> ] [ -l <em>live</em> ] [ -t <em>timeout</em> ] <em>scandir</em>
</pre>
<ul>
<li> <em>compiled</em>, <em>live</em> and <em>scandir</em> must be
absolute paths. </li>
<li> s6-rc-init expects to find a <em>compiled service database</em>
in <em>compiled</em>. It expects to be able to create a directory
at <em>live</em>. It also expects that an instance of
<a href="http://skarnet.org/software/s6/s6-svscan.html">s6-svscan</a>
is running on <em>scandir</em>. </li>
<li> s6-rc-init initializes the live state in <em>live</em>. It
declares <em>compiled</em> as the current service database and
sets the state as "all services down". </li>
<li> It then copies verbatim all
the service directories declared by <em>compiled</em> into a
subdirectory of <em>live</em>, adds down files to the live copies
and links them into <em>scandir</em>. It then triggers
<a href="http://skarnet.org/software/s6/s6-svscan.html">s6-svscan</a>,
which will pick up the new service directories and start
<a href="http://skarnet.org/software/s6/s6-supervise.html">s6-supervise</a>
processes on them - but the service themselves will not be started
right away, because of the down files. </li>
<li> s6-rc-init waits for all s6-supervise processes to be
operational, then exits 0. </li>
</ul>
<h2> Options </h2>
<ul>
<li> <tt>-t <em>timeout</em></tt> : if all
s6-supervise processes are not up and running after <em>timeout</em>
milliseconds, s6-rc-init will complain and exit 111. This is a
safety feature so s6-rc-init doesn't hang indefinitely on a
nonworking installation; normally this initialization should not take
more than a few milliseconds. </li>
<li> <tt>-c <em>compiled</em></tt> : declare <em>compiled</em>
as the current compiled service database for the upcoming live state.
Default is <tt>/etc/s6-rc/compiled</tt>. </li>
<li> <tt>-l <em>live</em></tt> : Store the live state into
the <em>live</em> directory, which should not exist prior to running
s6-rc-init, but should be under a writable filesystem - likely a RAM
filesystem. Default is
<tt>/run/s6-rc</tt>. The default can be changed at compile time by
giving the <tt>--livedir=<em>live</em></tt> option to
<tt>./configure</tt>. </li>
</ul>
<h2> Typical usage </h2>
<p>
Administrators should invoke <tt>s6-rc-init</tt> once, in their
early boot scripts, after s6-svscan is functional and ready to
supervise longrun services (and after its catch-all logger, if
any, has started), but before any
other initialization. (The rest of the initialization can be
written as a set of s6-rc services, and performed by just one
invocation of the <a href="s6-rc.html">s6-rc change</a> command.)
</p>
<p>
For instance, when using an init created by
<a href="http://skarnet.org/software/s6-linux-init/">s6-linux-init</a>,
<tt>s6-rc-init</tt> should be the first command in the
<em>stage2</em> (by default <tt>/etc/rc.init</tt>) script.
</p>
</body>
</html>
|