source: chapter09/usage6.xml@ 5497725

s6-init
Last change on this file since 5497725 was 5497725, checked in by Thomas Trepl (Moody) <thomas@…>, 20 months ago

Updates...

  • Property mode set to 100644
File size: 3.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 <!ENTITY site SYSTEM "../appendices/rc.site.script">
6 %general-entities;
7]>
8
9<sect1 id="ch-config-usage" revision="s6">
10 <?dbhtml filename="usage.html"?>
11
12 <title>S6 Usage and Configuration</title>
13
14 <para>Some information about S6 in general and in detail...</para>
15
16 <sect2>
17 <title>Terminology</title>
18
19 <para>
20 S6 does not look that trivial on the first view. Some
21 clarification on the terminology of S6 might help to understand
22 what is talked about.
23 </para>
24
25 <itemizedlist>
26 <listitem>
27 <para>service directory</para>
28 <para>
29 A directory, where your service definitions are
30 stored. That is the direcory where all the directories
31 containing <filename>type</filename>, <filename>up</filename>,
32 <filename>down</filename> and <filename>dependencies</filename>
33 resides in. In the service directory can be much more
34 service definitions be stored than you might actually are
35 going to use.
36 </para>
37 </listitem>
38
39 <listitem>
40 <para>scan directory</para>
41 <para>
42 Pretty much same structure as a <emphasis>service directory</emphasis>
43 but it contains only that services which are used on your
44 system. The scandir can contain symbolic links to services
45 in the <emphasis>service directory</emphasis>.
46 </para>
47 </listitem>
48 </itemizedlist>
49
50 </sect2>
51
52 <sect2>
53 <title>The boot scripts</title>
54
55 <para>Now setup some essential scripts for booting.</para>
56
57 <para>
58 After init has been started, the s6 rc.init file is read.
59 The file can be found in <filename class="directory">/etc/s6-linux-init/skel</filename>.
60 This file can be used to start the S6 service manager as well
61 as optionally other service managers. To enable s6-rc, execute
62 following command to uncomment the respective line:
63 </para>
64
65<screen><userinput>sed -e "s/^# s6-rc-init/s6-rc-init/" \
66 -i /etc/s6-linux-init/skel/rc.init</userinput></screen>
67
68 <note>
69 <para>
70 Whenever you change files in the skel directory, it is
71 required to reinstall them using the <filename>s6-linux-init-maker</filename>
72 script.
73 </para>
74 <para>
75 Execute the following commands to rebuild the files.
76 </para>
77 </note>
78
79<!--
80 Following setup is taken from
81 https://skarnet.org/software/s6-linux-init/quickstart.html
82 It builds the required programs (init, reboot, ...).
83
84 The system is bootable with this config, but it has
85 * only one tty (tty1)
86 * root-fs is mounted R/O
87 * no virtual filesystems (like /proc) are mounted
88 * messages breaks thru to console
89
90 ... but it boots ;-)
91-->
92 <para>Make sure that the configuration directory exists:</para>
93
94<screen><userinput>mkdir -p /etc/s6-linux-init</userinput></screen>
95
96 <para>Setup a temporary directory name (the directory itself
97 must not exist):</para>
98
99<screen><userinput>tmpdir=$(mktemp -d -u)</userinput></screen>
100
101 <para>Create essential programs and move them to a
102 directory representing the current setup:</para>
103
104<screen><userinput>s6-linux-init-maker -1 -G "/sbin/agetty -J 38400 tty1" $tmpdir
105mv $tmpdir /etc/s6-linux-init/current
106</userinput></screen>
107
108 <para>Install the essential programs in the file system:</para>
109
110<screen><userinput>cp -av /etc/s6-linux-init/current/bin/* /sbin/</userinput></screen>
111
112 </sect2>
113
114</sect1>
Note: See TracBrowser for help on using the repository browser.