Hardware Reference
In-Depth Information
Chapter 3
Initialization
After the Linux kernel is booted, the first executing userland process ID number (PID)
is 1. This process, known as
init
, is initially responsible for spawning all other required
processes required by the system. The
init
process continues to execute after the system
is up, running as a daemon (in the background). It should never be terminated by the
user (when attempted on Raspbian Linux, the kill request was ignored).
Run Levels
The
init
process maintains a concept of a run level for the system. The current run level
can be checked at the command line:
$ runlevel
N 2
$
The
N
shown here is the previous run level that was in effect. This
N
means that there
was no prior run level. The
2
shown at the right is the current run-level number.
Raspbian Linux supports the run levels shown in Table
3-1
. According to the action
defined in Raspbian Linux's
/etc/inittab
file, it changes to run level 2 by default (see
the
/etc/inittab
line with the
initdefault
action, which is described later). If problems
are encountered, such as a corrupted root file system, the run level is taken to
single-
user mode
(1). This allows the user at the console to repair the problem and resume the
transition to a multiuser run level (normally 2) afterward.
Table 3-1.
Raspbian Run Levels
Run Level
Meaning
Notes
S or s
Used at initial boot
Reserved
0
Halt
Reserved
1
Single-user mode
Reserved
2
Multiuser mode
Default
3
Multiuser mode
(
continued
)