Files
lfs/chapter09/introduction.xml
Zeckmathederg b67bea305c Provide OpenRC support.
This doesn't replace Systemd or SysVinit rendering options.

When going through, I discovered some issues with the main OpenRC branch
which I fixed along the way. There is a UEFI issue I'm embarresed I
didn't notice yet, which was a /boot/efi entry in the /etc/fstab
section. So I will resolve that soon here.
2026-04-06 21:09:52 -06:00

135 lines
4.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-config-introduction" revision="openrc,sysv">
<?dbhtml filename="introduction.html"?>
<title>Introduction</title>
<para>Booting a Linux system involves several tasks. The process must
mount both virtual and real file systems, initialize devices,
check file systems for integrity, mount and activate any swap partitions or files, set
the system clock, bring up networking, start any daemons required by the
system, and accomplish any other custom tasks specified by the user. This
process must be organized to ensure the tasks are performed in the correct
order and executed as quickly as possible.</para>
<sect2 revision='openrc' id='openrc-desc'>
<title>OpenRC</title>
<para>OpenRC combines the methodology of both SysVinit and Systemd.
OpenRC has the concept of services with dependency information, yet it uses
a run level scheme which is similar to SysVinit. OpenRC, like SysVinit and
Systemd, uses <command>init</command> and starts up every process and
daemon as required. While you can choose which run level you want to be on,
<literal>default</literal> has the most services and is the default. For
information on run levels, see <xref linkend="ch-config-usage"/>.</para>
</sect2>
<sect2 revision='sysv' id='sysv-desc'>
<title>System V</title>
<para>System V is the classic boot process that has been used in Unix and
Unix-like systems such as Linux since about 1983. It consists of a small
program, <command>init</command>, that sets up basic processes such as
<command>login</command> (via getty) and runs a script. This script,
usually named <command>rc</command>, controls the execution of a set of
additional scripts that perform the tasks required to initialize the
system.</para>
<para>The <command>init</command> program is controlled by the
<filename>/etc/inittab</filename> file and is organized into run levels that
can be chosen by the user. In LFS, they are used as follows:</para>
<literallayout>0 &mdash; halt
1 &mdash; Single user mode
2 &mdash; User definable
3 &mdash; Full multiuser mode
4 &mdash; User definable
5 &mdash; Full multiuser mode with display manager
6 &mdash; reboot</literallayout>
<para>The usual default run level is 3 or 5.</para>
</sect2>
<sect2>
<title>Advantages</title>
<itemizedlist>
<listitem>
<para>Established, well understood system.</para>
</listitem>
<listitem>
<para>Easy to customize.</para>
</listitem>
<listitem revision="openrc">
<para>Well supported and backed by major Linux distributions.</para>
</listitem>
<listitem revision="openrc">
<para>Parallelized.</para>
</listitem>
<listitem revision="openrc">
<para>Cgroups support.</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Disadvantages</title>
<itemizedlist>
<listitem revision="openrc">
<para>It is not as convenient as Systemd.</para>
</listitem>
<listitem revision="openrc">
<para>It does not provide the amount of tooling Systemd does.</para>
</listitem>
<listitem revision="openrc">
<para>Certain features that projects depend on that only exist in
Systemd may take a while before seeing parity in OpenRC.</para>
</listitem>
<listitem revision="sysv">
<para>May be slower to boot. A medium speed base LFS system
takes 8-12 seconds where the boot time is measured from the
first kernel message to the login prompt. Network
connectivity is typically established about 2 seconds
after the login prompt.</para>
</listitem>
<listitem revision="sysv">
<para>Serial processing of boot tasks. This is related to the previous
point. A delay in any process, such as a file system check, will
delay the entire boot process.</para>
</listitem>
<listitem revision="sysv">
<para>Does not directly support advanced features like
control groups (cgroups) and per-user fair share scheduling.</para>
</listitem>
<listitem revision="sysv">
<para>Adding scripts requires manual, static sequencing decisions.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>