]> git.proxmox.com Git - systemd.git/blame - man/bootup.7
Imported Upstream version 221
[systemd.git] / man / bootup.7
CommitLineData
14228c0d 1'\" t
86f210e9 2.TH "BOOTUP" "7" "" "systemd 221" "bootup"
14228c0d
MB
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23bootup \- System bootup process
24.SH "DESCRIPTION"
25.PP
26A number of different components are involved in the system boot\&. Immediately after power\-up, the system BIOS will do minimal hardware initialization, and hand control over to a boot loader stored on a persistent storage device\&. This boot loader will then invoke an OS kernel from disk (or the network)\&. In the Linux case, this kernel (optionally) extracts and executes an initial RAM disk image (initrd), such as generated by
27\fBdracut\fR(8), which looks for the root file system (possibly using
28\fBsystemd\fR(1)
29for this)\&. After the root file system is found and mounted, the initrd hands over control to the host\*(Aqs system manager (such as
30\fBsystemd\fR(1)) stored on the OS image, which is then responsible for probing all remaining hardware, mounting all necessary file systems and spawning all configured services\&.
31.PP
32On shutdown, the system manager stops all services, unmounts all file systems (detaching the storage technologies backing them), and then (optionally) jumps back into the initrd code which unmounts/detaches the root file system and the storage it resides on\&. As a last step, the system is powered down\&.
33.PP
34Additional information about the system boot process may be found in
35\fBboot\fR(7)\&.
36.SH "SYSTEM MANAGER BOOTUP"
37.PP
38At boot, the system manager on the OS image is responsible for initializing the required file systems, services and drivers that are necessary for operation of the system\&. On
39\fBsystemd\fR(1)
40systems, this process is split up in various discrete steps which are exposed as target units\&. (See
41\fBsystemd.target\fR(5)
42for detailed information about target units\&.) The boot\-up process is highly parallelized so that the order in which specific target units are reached is not deterministic, but still adheres to a limited amount of ordering structure\&.
43.PP
44When systemd starts up the system, it will activate all units that are dependencies of
45default\&.target
46(as well as recursively all dependencies of these dependencies)\&. Usually,
47default\&.target
48is simply an alias of
49graphical\&.target
50or
51multi\-user\&.target, depending on whether the system is configured for a graphical UI or only for a text console\&. To enforce minimal ordering between the units pulled in, a number of well\-known target units are available, as listed on
52\fBsystemd.special\fR(7)\&.
53.PP
54The following chart is a structural overview of these well\-known units and their position in the boot\-up logic\&. The arrows describe which units are pulled in and ordered before which other units\&. Units near the top are started before units nearer to the bottom of the chart\&.
55.sp
56.if n \{\
57.RS 4
58.\}
59.nf
60local\-fs\-pre\&.target
61 |
62 v
63(various mounts and (various swap (various cryptsetup
64 fsck services\&.\&.\&.) devices\&.\&.\&.) devices\&.\&.\&.) (various low\-level (various low\-level
65 | | | services: udevd, API VFS mounts:
66 v v v tmpfiles, random mqueue, configfs,
67 local\-fs\&.target swap\&.target cryptsetup\&.target seed, sysctl, \&.\&.\&.) debugfs, \&.\&.\&.)
68 | | | | |
69 \e__________________|_________________ | ___________________|____________________/
70 \e|/
71 v
72 sysinit\&.target
73 |
74 ____________________________________/|\e________________________________________
75 / | | | \e
76 | | | | |
77 v v | v v
78 (various (various | (various rescue\&.service
79 timers\&.\&.\&.) paths\&.\&.\&.) | sockets\&.\&.\&.) |
80 | | | | v
81 v v | v \fIrescue\&.target\fR
82 timers\&.target paths\&.target | sockets\&.target
83 | | | |
e3bff60a 84 v \e_________________ | ___________________/
14228c0d
MB
85 \e|/
86 v
87 basic\&.target
88 |
89 ____________________________________/| emergency\&.service
90 / | | |
91 | | | v
92 v v v \fIemergency\&.target\fR
93 display\- (various system (various system
94 manager\&.service services services)
95 | required for |
96 | graphical UIs) v
97 | | \fImulti\-user\&.target\fR
98 | | |
99 \e_________________ | _________________/
100 \e|/
101 v
102 \fIgraphical\&.target\fR
103.fi
104.if n \{\
105.RE
106.\}
107.PP
108Target units that are commonly used as boot targets are
109\fIemphasized\fR\&. These units are good choices as goal targets, for example by passing them to the
110\fIsystemd\&.unit=\fR
111kernel command line option (see
112\fBsystemd\fR(1)) or by symlinking
113default\&.target
114to them\&.
f47781d8
MP
115.PP
116timers\&.target
117is pulled\-in by
118basic\&.target
119asynchronously\&. This allows timers units to depend on services which become only available later in boot\&.
14228c0d
MB
120.SH "BOOTUP IN THE INITIAL RAM DISK (INITRD)"
121.PP
122The initial RAM disk implementation (initrd) can be set up using systemd as well\&. In this case, boot up inside the initrd follows the following structure\&.
123.PP
124The default target in the initrd is
125initrd\&.target\&. The bootup process begins identical to the system manager bootup (see above) until it reaches
126basic\&.target\&. From there, systemd approaches the special target
127initrd\&.target\&. If the root device can be mounted at
128/sysroot, the
129sysroot\&.mount
130unit becomes active and
131initrd\-root\-fs\&.target
132is reached\&. The service
133initrd\-parse\-etc\&.service
134scans
135/sysroot/etc/fstab
136for a possible
137/usr
138mount point and additional entries marked with the
139\fIx\-initrd\&.mount\fR
140option\&. All entries found are mounted below
141/sysroot, and
142initrd\-fs\&.target
143is reached\&. The service
144initrd\-cleanup\&.service
145isolates to the
146initrd\-switch\-root\&.target, where cleanup services can run\&. As the very last step, the
147initrd\-switch\-root\&.service
148is activated, which will cause the system to switch its root to
149/sysroot\&.
150.sp
151.if n \{\
152.RS 4
153.\}
154.nf
155 : (beginning identical to above)
156 :
157 v
158 basic\&.target
159 | emergency\&.service
160 ______________________/| |
161 / | v
162 | sysroot\&.mount \fIemergency\&.target\fR
163 | |
164 | v
165 | initrd\-root\-fs\&.target
166 | |
167 | v
168 v initrd\-parse\-etc\&.service
169 (custom initrd |
170 services\&.\&.\&.) v
171 | (sysroot\-usr\&.mount and
172 | various mounts marked
173 | with fstab option
174 | x\-initrd\&.mount\&.\&.\&.)
175 | |
176 | v
177 | initrd\-fs\&.target
178 \e______________________ |
179 \e|
180 v
181 initrd\&.target
182 |
183 v
184 initrd\-cleanup\&.service
185 isolates to
186 initrd\-switch\-root\&.target
187 |
188 v
189 ______________________/|
190 / v
191 | initrd\-udevadm\-cleanup\-db\&.service
192 v |
193 (custom initrd |
194 services\&.\&.\&.) |
195 \e______________________ |
196 \e|
197 v
198 initrd\-switch\-root\&.target
199 |
200 v
201 initrd\-switch\-root\&.service
202 |
203 v
204 Transition to Host OS
205.fi
206.if n \{\
207.RE
208.\}
209.SH "SYSTEM MANAGER SHUTDOWN"
210.PP
211System shutdown with systemd also consists of various target units with some minimal ordering structure applied:
212.sp
213.if n \{\
214.RS 4
215.\}
216.nf
217 (conflicts with (conflicts with
218 all system all file system
219 services) mounts, swaps,
220 | cryptsetup
221 | devices, \&.\&.\&.)
222 | |
223 v v
224 shutdown\&.target umount\&.target
225 | |
226 \e_______ ______/
227 \e /
228 v
229 (various low\-level
230 services)
231 |
232 v
233 final\&.target
234 |
235 _____________________________________/ \e_________________________________
236 / | | \e
237 | | | |
238 v v v v
239systemd\-reboot\&.service systemd\-poweroff\&.service systemd\-halt\&.service systemd\-kexec\&.service
240 | | | |
241 v v v v
242 \fIreboot\&.target\fR \fIpoweroff\&.target\fR \fIhalt\&.target\fR \fIkexec\&.target\fR
243.fi
244.if n \{\
245.RE
246.\}
247.PP
248Commonly used system shutdown targets are
249\fIemphasized\fR\&.
250.SH "SEE ALSO"
251.PP
252\fBsystemd\fR(1),
253\fBboot\fR(7),
254\fBsystemd.special\fR(7),
255\fBsystemd.target\fR(5),
256\fBdracut\fR(8)