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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
|
<!-- vim: set sw=2 et sts=2 ft=xml: -->
<!-- Last content review: 2024-01-21T04:16:04 UTC -->
<chapter id="_the_system_initialization">
<title>The system initialization</title>
<para>It is wise for you as the system administrator to know roughly how the Debian system is started and configured. Although the exact details are in the source files of the packages installed and their documentations, it is a bit overwhelming for most of us.</para>
<para>Here is a rough overview of the key points of the Debian system initialization. Since the Debian system is a moving target, you should refer to the latest documentation.</para>
<itemizedlist>
<listitem> <para> <ulink url="https://kernel-team.pages.debian.net/kernel-handbook/index.html">Debian Linux Kernel Handbook</ulink> is the primary source of information on the Debian kernel.</para> </listitem>
<listitem> <para> <literal>bootup</literal>(7) describes the system bootup process based on <literal>systemd</literal> . (Recent Debian)</para> </listitem>
<listitem> <para> <literal>boot</literal>(7) describes the system bootup process based on UNIX System V Release 4. (Older Debian)</para> </listitem>
</itemizedlist>
<section id="_an_overview_of_the_boot_strap_process">
<title>An overview of the boot strap process</title>
<para>The computer system undergoes several phases of <ulink url="https://en.wikipedia.org/wiki/Booting">boot strap processes</ulink> from the power-on event until it offers the fully functional operating system (OS) to the user.</para>
<para>For simplicity, I limit discussion to the typical PC platform with the default installation.</para>
<para>The typical boot strap process is like a four-stage rocket. Each stage rocket hands over the system control to the next stage one.</para>
<itemizedlist>
<listitem> <para> <xref linkend="_stage_1_the_uefi"/> </para> </listitem>
<listitem> <para> <xref linkend="_stage_2_the_boot_loader"/> </para> </listitem>
<listitem> <para> <xref linkend="_stage_3_the_mini_debian_system"/> </para> </listitem>
<listitem> <para> <xref linkend="_stage_4_the_normal_debian_system"/> </para> </listitem>
</itemizedlist>
<para>Of course, these can be configured differently. For example, if you compiled your own kernel, you may be skipping the step with the mini-Debian system. So please do not assume this is the case for your system until you check it yourself.</para>
<section id="_stage_1_the_uefi">
<title>Stage 1: the UEFI</title>
<para>The <ulink url="https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface">Unified Extensible Firmware Interface (UEFI)</ulink> defines a boot manager as part of the UEFI specification. When a computer is powered on, the boot manager is the 1st stage of the boot process which checks the boot configuration and based on its settings, then executes the specified OS boot loader or operating system kernel (usually boot loader). The boot configuration is defined by variables stored in NVRAM, including variables that indicate the file system paths to OS loaders or OS kernels.</para>
<para>An <ulink url="https://en.wikipedia.org/wiki/EFI_system_partition">EFI system partition (ESP)</ulink> is a data storage device partition that is used in computers adhering to the UEFI specification. Accessed by the UEFI firmware when a computer is powered up, it stores UEFI applications and the files these applications need to run, including operating system boot loaders. (On the legacy PC system, <ulink url="https://en.wikipedia.org/wiki/BIOS">BIOS</ulink> stored in the <ulink url="https://en.wikipedia.org/wiki/Master_boot_record">MBR</ulink> may be used instead.)</para>
</section>
<section id="_stage_2_the_boot_loader">
<title>Stage 2: the boot loader</title>
<para>The <ulink url="https://en.wikipedia.org/wiki/Boot_loader">boot loader</ulink> is the 2nd stage of the boot process which is started by the UEFI. It loads the system kernel image and the <ulink url="https://en.wikipedia.org/wiki/Initrd">initrd</ulink> image to the memory and hands control over to them. This initrd image is the root filesystem image and its support depends on the bootloader used.</para>
<para>The Debian system normally uses the Linux kernel as the default system kernel. The initrd image for the current 5.x Linux kernel is technically the <ulink url="https://wiki.debian.org/initramfs">initramfs</ulink> (initial RAM filesystem) image.</para>
<para>There are many boot loaders and configuration options available.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of boot loaders</title>
<tgroup cols="6">
<colspec colwidth="81pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="342pt" align="left"/>
<colspec colwidth="738pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> initrd </entry>
<entry> bootloader </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> grub-efi-amd64 </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_GRUB">GRUB UEFI</ulink> </entry>
<entry> This is smart enough to understand disk partitions and filesystems such as vfat, ext4, …. (UEFI) </entry>
</row>
<row>
<entry> grub-pc </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_GRUB">GRUB 2</ulink> </entry>
<entry> This is smart enough to understand disk partitions and filesystems such as vfat, ext4, …. (BIOS) </entry>
</row>
<row>
<entry> grub-rescue-pc </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_GRUB">GRUB 2</ulink> </entry>
<entry> This is GRUB 2 bootable rescue images (CD and floppy) (PC/BIOS version) </entry>
</row>
<row>
<entry> syslinux </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/SYSLINUX">Isolinux</ulink> </entry>
<entry> This understands the ISO9660 filesystem. This is used by the boot CD. </entry>
</row>
<row>
<entry> syslinux </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/SYSLINUX">Syslinux</ulink> </entry>
<entry> This understands the <ulink url="https://en.wikipedia.org/wiki/File_Allocation_Table">MSDOS filesystem (FAT)</ulink>. This is used by the boot floppy. </entry>
</row>
<row>
<entry> loadlin </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Supported </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Loadlin">Loadlin</ulink> </entry>
<entry> New system is started from the FreeDOS/MSDOS system. </entry>
</row>
<row>
<entry> mbr </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> Not supported </entry>
<entry> <ulink url="https://www.chiark.greenend.org.uk/~neilt/">MBR by Neil Turton</ulink> </entry>
<entry> This is free software which substitutes MSDOS <ulink url="https://en.wikipedia.org/wiki/Master_boot_record">MBR</ulink>. This only understands disk partitions. </entry>
</row>
</tbody>
</tgroup>
</table>
<warning> <para>Do not play with boot loaders without having bootable rescue media (USB memory stick, CD or floppy) created from images in the <literal>grub-rescue-pc</literal> package. It makes you boot your system even without functioning bootloader on the hard disk.</para> </warning>
<para>For UEFI system, GRUB2 first reads the ESP partition and uses UUID specified for <literal>search.fs_uuid</literal> in "<literal>/boot/efi/EFI/debian/grub.cfg</literal>" to determine the partition of the GRUB2 menu configuration file "<literal>/boot/grub/grub.cfg</literal>". </para>
<para>The key part of the GRUB2 menu configuration file looks like:</para>
<screen>menuentry 'Debian GNU/Linux' ... {
load_video
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root fe3e1db5-6454-46d6-a14c-071208ebe4b1
echo 'Loading Linux 5.10.0-6-amd64 ...'
linux /boot/vmlinuz-5.10.0-6-amd64 root=UUID=fe3e1db5-6454-46d6-a14c-071208ebe4b1 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-6-amd64
}</screen>
<para>For this part of <literal>/boot/grub/grub.cfg</literal>, this menu entry means the following.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>The meaning of the menu entry of the above part of <literal>/boot/grub/grub.cfg</literal></title>
<tgroup cols="2">
<colspec colwidth="278pt" align="left"/>
<colspec colwidth="400pt" align="left"/>
<thead>
<row>
<entry> setting </entry>
<entry> value </entry>
</row>
</thead>
<tbody>
<row>
<entry> GRUB2 modules loaded </entry>
<entry> <literal>gzio</literal>, <literal>part_gpt</literal>, <literal>ext2</literal> </entry>
</row>
<row>
<entry> root file system partition used </entry>
<entry> partition identified by <literal>UUID=fe3e1db5-6454-46d6-a14c-071208ebe4b1</literal> </entry>
</row>
<row>
<entry> kernel image path in the root file system </entry>
<entry> <literal>/boot/vmlinuz-5.10.0-6-amd64</literal> </entry>
</row>
<row>
<entry> kernel boot parameter used </entry>
<entry> "<literal>root=UUID=fe3e1db5-6454-46d6-a14c-071208ebe4b1 ro quiet</literal>" </entry>
</row>
<row>
<entry> initrd image path in the root file system </entry>
<entry> <literal>/boot/initrd.img-5.10.0-6-amd64</literal> </entry>
</row>
</tbody>
</tgroup>
</table>
<tip><para>You can enable to see kernel boot log messages by removing <literal>quiet</literal> in "<literal>/boot/grub/grub.cfg</literal>". For the persistent change, please edit "<literal>GRUB_CMDLINE_LINUX_DEFAULT="quiet"</literal>" line in "<literal>/etc/default/grub</literal>". </para></tip>
<tip><para>You can customize GRUB splash image by setting <literal>GRUB_BACKGROUND</literal> variable in "<literal>/etc/default/grub</literal>" pointing to the image file or placing the image file itself in "<literal>/boot/grub/</literal>". </para></tip>
<para>See "<literal>info grub</literal>" and <literal>grub-install</literal>(8).</para>
</section>
<section id="_stage_3_the_mini_debian_system">
<title>Stage 3: the mini-Debian system</title>
<para>The mini-Debian system is the 3rd stage of the boot process which is started by the boot loader. It runs the system kernel with its root filesystem on the memory. This is an optional preparatory stage of the boot process.</para>
<note> <para>The term "the mini-Debian system" is coined by the author to describe this 3rd stage boot process for this document. This system is commonly referred as the <ulink url="https://en.wikipedia.org/wiki/Initrd">initrd</ulink> or initramfs system. Similar system on the memory is used by <ulink url="https://www.debian.org/devel/debian-installer/">the Debian Installer</ulink>.</para> </note>
<para>The "<literal>/init</literal>" program is executed as the first program in this root filesystem on the memory. It is a program which initializes the kernel in user space and hands control over to the next stage. This mini-Debian system offers flexibility to the boot process such as adding kernel modules before the main boot process or mounting the root filesystem as an encrypted one.</para>
<itemizedlist>
<listitem>
<para> The "<literal>/init</literal>" program is a shell script program if initramfs was created by <literal>initramfs-tools</literal>. </para>
<itemizedlist>
<listitem> <para> You can interrupt this part of the boot process to gain root shell by providing "<literal>break=init</literal>" etc. to the kernel boot parameter. See the "<literal>/init</literal>" script for more break conditions. This shell environment is sophisticated enough to make a good inspection of your machine's hardware. </para> </listitem>
<listitem> <para> Commands available in this mini-Debian system are stripped down ones and mainly provided by a GNU tool called <literal>busybox</literal>(1). </para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> The "<literal>/init</literal>" program is a binary <literal>systemd</literal> program if initramfs was created by <literal>dracut</literal>. </para>
<itemizedlist>
<listitem> <para> Commands available in this mini-Debian system are stripped down <literal>systemd</literal>(1) environment. </para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<caution> <para>You need to use "<literal>-n</literal>" option for <literal>mount</literal> command when you are on the readonly root filesystem.</para> </caution>
</section>
<section id="_stage_4_the_normal_debian_system">
<title>Stage 4: the normal Debian system</title>
<para>The normal Debian system is the 4th stage of the boot process which is started by the mini-Debian system. The system kernel for the mini-Debian system continues to run in this environment. The root filesystem is switched from the one on the memory to the one on the real hard disk filesystem.</para>
<para>The <ulink url="https://en.wikipedia.org/wiki/Init">init</ulink> program is executed as the first program with PID=1 to perform the main boot process of starting many programs. The default file path for the init program is "<literal>/usr/sbin/init</literal>" but it can be changed by the kernel boot parameter as "<literal>init=/path/to/init_program</literal>".</para>
<para>"<literal>/usr/sbin/init</literal>" is symlinked to "<literal>/lib/systemd/systemd</literal>" after Debian 8 Jessie (released in 2015).</para>
<tip> <para>The actual init command on your system can be verified by the "<literal>ps --pid 1 -f</literal>" command.</para> </tip>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of boot utilities for the Debian system</title>
<tgroup cols="4">
<colspec colwidth="119pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="423pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>systemd</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> event-based <literal>init</literal>(8) daemon for concurrency (alternative to <literal>sysvinit</literal>) </entry>
</row>
<row>
<entry> <literal>cloud-init</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink link="https://cloud-init.io/">initialization system for infrastructure cloud instances</ulink> </entry>
</row>
<row>
<entry> <literal>systemd-sysv</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> the manual pages and links needed for <literal>systemd</literal> to replace <literal>sysvinit</literal> </entry>
</row>
<row>
<entry> <literal>init-system-helpers</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> helper tools for switching between <literal>sysvinit</literal> and <literal>systemd</literal> </entry>
</row>
<row>
<entry> <literal>initscripts</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> scripts for initializing and shutting down the system </entry>
</row>
<row>
<entry> <literal>sysvinit-core</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> System-V-like <literal>init</literal>(8) utilities </entry>
</row>
<row>
<entry> <literal>sysv-rc</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> System-V-like runlevel change mechanism </entry>
</row>
<row>
<entry> <literal>sysvinit-utils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> System-V-like utilities (<literal>startpar</literal>(8), <literal>bootlogd</literal>(8), …) </entry>
</row>
<row>
<entry> <literal>lsb-base</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Linux_Standard_Base">Linux Standard Base</ulink> 3.2 init script functionality </entry>
</row>
<row>
<entry> <literal>insserv</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> tool to organize boot sequence using LSB init.d script dependencies </entry>
</row>
<row>
<entry> <literal>kexec-tools</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> kexec tool for <literal>kexec</literal>(8) reboots (warm reboot) </entry>
</row>
<row>
<entry> <literal>systemd-bootchart</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> boot process performance analyser </entry>
</row>
<!--
<row>
<entry> <literal>bootchart2</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> boot process performance analyser </entry>
</row>
<row>
<entry> <literal>pybootchartgui</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> boot process performance analyser (visualisation) </entry>
</row>
-->
<row>
<entry> <literal>mingetty</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> console-only <literal>getty</literal>(8) </entry>
</row>
<row>
<entry> <literal>mgetty</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> smart modem <literal>getty</literal>(8) replacement </entry>
</row>
</tbody>
</tgroup>
</table>
<tip> <para>See <ulink url="https://wiki.debian.org/BootProcessSpeedup">Debian wiki: BootProcessSpeedup</ulink> for the latest tips to speed up the boot process.</para> </tip>
</section>
</section>
<section id="_systemd">
<title>Systemd</title>
<section id="_systemd_init">
<title>Systemd init</title>
<para>When the Debian system starts, <literal>/usr/sbin/init</literal> symlinked to <literal>/usr/lib/systemd</literal> is started as the init system process (<literal>PID=1</literal>) owned by root (<literal>UID=0</literal>). See <literal>systemd</literal>(1).</para>
<para>The <literal>systemd</literal> init process spawns processes in parallel based on the unit configuration files (see <literal>systemd.unit</literal>(5)) which are written in declarative style instead of SysV-like procedural style.</para>
<para>The spawned processes are placed in individual <ulink url="https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html">Linux control groups</ulink> named after the unit which they belong to in the private systemd hierarchy (see <ulink url="https://en.wikipedia.org/wiki/Cgroups">cgroups</ulink> and <xref linkend="_linux_security_features"/>).</para>
<para>Units for the system mode are loaded from the "System Unit Search Path" described in <literal>systemd.unit</literal>(5). The main ones are as follows in the order of priority:</para>
<itemizedlist>
<listitem> <para> "<literal>/etc/systemd/system/*</literal>": System units created by the administrator </para> </listitem>
<listitem> <para> "<literal>/run/systemd/system/*</literal>": Runtime units </para> </listitem>
<listitem> <para> "<literal>/lib/systemd/system/*</literal>": System units installed by the distribution package manager </para> </listitem>
</itemizedlist>
<para>Their inter-dependencies are specified by the directives "<literal>Wants=</literal>", "<literal>Requires=</literal>", "<literal>Before=</literal>", "<literal>After=</literal>", … (see "MAPPING OF UNIT PROPERTIES TO THEIR INVERSES" in <literal>systemd.unit</literal>(5)). The resource controls are also defined (see <literal>systemd.resource-control</literal>(5)).</para>
<para>The suffix of the unit configuration file encodes their types as:</para>
<itemizedlist>
<listitem> <para><emphasis role="strong">*.service</emphasis> describes the process controlled and supervised by <literal>systemd</literal>. See <literal>systemd.service</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.device</emphasis> describes the device exposed in the <literal>sysfs</literal>(5) as <literal>udev</literal>(7) device tree. See <literal>systemd.device</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.mount</emphasis> describes the file system mount point controlled and supervised by <literal>systemd</literal>. See <literal>systemd.mount</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.automount</emphasis> describes the file system auto mount point controlled and supervised by <literal>systemd</literal>. See <literal>systemd.automount</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.swap</emphasis> describes the swap device or file controlled and supervised by <literal>systemd</literal>. See <literal>systemd.swap</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.path</emphasis> describes the path monitored by <literal>systemd</literal> for path-based activation. See <literal>systemd.path</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.socket</emphasis> describes the socket controlled and supervised by <literal>systemd</literal> for socket-based activation. See <literal>systemd.socket</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.timer</emphasis> describes the timer controlled and supervised by <literal>systemd</literal> for timer-based activation. See <literal>systemd.timer</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.slice</emphasis> manages resources with the <literal>cgroups</literal>(7). See <literal>systemd.slice</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.scope</emphasis> is created programmatically using the bus interfaces of <literal>systemd</literal> to manages a set of system processes. See <literal>systemd.scope</literal>(5). </para> </listitem>
<listitem> <para><emphasis role="strong">*.target</emphasis> groups other unit configuration files to create the synchronization point during start-up. See <literal>systemd.target</literal>(5). </para> </listitem>
</itemizedlist>
<para>Upon system start up (i.e., init), the <literal>systemd</literal> process tries to start the "<literal>/lib/systemd/system/default.target</literal> (normally symlinked to "<literal>graphical.target</literal>"). First, some special target units (see <literal>systemd.special</literal>(7)) such as "<literal>local-fs.target</literal>", "<literal>swap.target</literal>" and "<literal>cryptsetup.target</literal>" are pulled in to mount the filesystems. Then, other target units are also pulled in by the target unit dependencies. For details, read <literal>bootup</literal>(7).</para>
<para><literal>systemd</literal> offers backward compatibility features. SysV-style boot scripts in "<literal>/etc/init.d/rc[0123456S].d/[KS]<emphasis>name</emphasis></literal>" are still parsed and <literal>telinit</literal>(8) is translated into systemd unit activation requests.</para>
<caution> <para>Emulated runlevel 2 to 4 are all symlinked to the same "<literal>multi-user.target</literal>".</para> </caution>
</section>
<section id="_systemd_login">
<title>Systemd login</title>
<para>When a user logins to the Debian system via <literal>gdm3</literal>(8), <literal>sshd</literal>(8), etc., <literal>/lib/systemd/system --user</literal> is started as the user service manager process owned by the corresponding user. See <literal>systemd</literal>(1).</para>
<para>The <literal>systemd</literal> user service manager process spawns processes in parallel based on the declarative unit configuration files (see <literal>systemd.unit</literal>(5) and <literal>user@.service</literal>(5)).</para>
<para>Units for the user mode are loaded from the "User Unit Search Path" described in <literal>systemd.unit</literal>(5). The main ones are as follows in the order of priority:</para>
<itemizedlist>
<listitem> <para> "<literal>~/.config/systemd/user/*</literal>": User configuration units </para> </listitem>
<listitem> <para> "<literal>/etc/systemd/user/*</literal>": User units created by the administrator </para> </listitem>
<listitem> <para> "<literal>/run/systemd/user/*</literal>": Runtime units </para> </listitem>
<listitem> <para> "<literal>/lib/systemd/user/*</literal>": User units installed by the distribution package manager </para> </listitem>
</itemizedlist>
<para>These are managed in the same way as <xref linkend="_systemd_init"/>.</para>
</section>
</section>
<section id="_the_kernel_message">
<title>The kernel message</title>
<para>The kernel error message displayed to the console can be configured by setting its threshold level.</para>
<screen># dmesg -n3</screen>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of kernel error levels</title>
<tgroup cols="3">
<colspec colwidth="97pt" align="left"/>
<colspec colwidth="92pt" align="left"/>
<colspec colwidth="179pt" align="left"/>
<thead>
<row>
<entry> error level value </entry>
<entry> error level name </entry>
<entry> meaning </entry>
</row>
</thead>
<tbody>
<row>
<entry> 0 </entry>
<entry> KERN_EMERG </entry>
<entry> system is unusable </entry>
</row>
<row>
<entry> 1 </entry>
<entry> KERN_ALERT </entry>
<entry> action must be taken immediately </entry>
</row>
<row>
<entry> 2 </entry>
<entry> KERN_CRIT </entry>
<entry> critical conditions </entry>
</row>
<row>
<entry> 3 </entry>
<entry> KERN_ERR </entry>
<entry> error conditions </entry>
</row>
<row>
<entry> 4 </entry>
<entry> KERN_WARNING </entry>
<entry> warning conditions </entry>
</row>
<row>
<entry> 5 </entry>
<entry> KERN_NOTICE </entry>
<entry> normal but significant condition </entry>
</row>
<row>
<entry> 6 </entry>
<entry> KERN_INFO </entry>
<entry> informational </entry>
</row>
<row>
<entry> 7 </entry>
<entry> KERN_DEBUG </entry>
<entry> debug-level messages </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="_the_system_message">
<title>The system message</title>
<para>Under <literal>systemd</literal>, both kernel and system messages are logged by the journal service <literal>systemd-journald.service</literal> (a.k.a <literal>journald</literal>) either into a persistent binary data below "<literal>/var/log/journal</literal>" or into a volatile binary data below "<literal>/run/log/journal/</literal>". These binary log data are accessed by the <literal>journalctl</literal>(1) command. For example, you can display log from the last boot as:</para>
<screen>$ journalctl -b</screen>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of typical <literal>journalctl</literal> command snippets</title>
<tgroup cols="2">
<colspec colwidth="341pt" align="left"/>
<colspec colwidth="320pt" align="left"/>
<thead>
<row>
<entry> Operation </entry>
<entry> Command snippets </entry>
</row>
</thead>
<tbody>
<row>
<entry> View log for system services and kernel from the last boot </entry>
<entry> "<literal>journalctl -b --system</literal>" </entry>
</row>
<row>
<entry> View log for services of the current user from the last boot </entry>
<entry> "<literal>journalctl -b --user</literal>" </entry>
</row>
<row>
<entry> View job log of "<literal>$unit</literal>" from the last boot </entry>
<entry> "<literal>journalctl -b -u $unit</literal>" </entry>
</row>
<row>
<entry> View job log of "<literal>$unit</literal>" ("<literal>tail -f</literal>" style) from the last boot </entry>
<entry> "<literal>journalctl -b -u $unit -f</literal>" </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Under <literal>systemd</literal>, the system logging utility <literal>rsyslogd</literal>(8) may be uninstalled. If it is installed, it changes its behavior to read the volatile binary log data (instead of pre-systemd default "<literal>/dev/log</literal>") and to create traditional permanent ASCII system log data. This can be customized by "<literal>/etc/default/rsyslog</literal>" and "<literal>/etc/rsyslog.conf</literal>" for both the log file and on-screen display. See <literal>rsyslogd</literal>(8) and <literal>rsyslog.conf</literal>(5). See also <xref linkend="_log_analyzer"/>.</para>
</section>
<section id="_system_management_operations">
<title>System management</title>
<para>The <literal>systemd</literal> offers not only init system but also generic system management operations with the <literal>systemctl</literal>(1) command.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of typical <literal>systemctl</literal> command snippets</title>
<tgroup cols="2">
<colspec colwidth="341pt" align="left"/>
<colspec colwidth="320pt" align="left"/>
<thead>
<row>
<entry> Operation </entry>
<entry> Command snippets </entry>
</row>
</thead>
<tbody>
<row>
<entry> List all available unit types </entry>
<entry> "<literal>systemctl list-units --type=help</literal>" </entry>
</row>
<row>
<entry> List all target units in memory </entry>
<entry> "<literal>systemctl list-units --type=target</literal>" </entry>
</row>
<row>
<entry> List all service units in memory </entry>
<entry> "<literal>systemctl list-units --type=service</literal>" </entry>
</row>
<row>
<entry> List all device units in memory </entry>
<entry> "<literal>systemctl list-units --type=device</literal>" </entry>
</row>
<row>
<entry> List all mount units in memory </entry>
<entry> "<literal>systemctl list-units --type=mount</literal>" </entry>
</row>
<row>
<entry> List all socket units in memory </entry>
<entry> "<literal>systemctl list-sockets</literal>" </entry>
</row>
<row>
<entry> List all timer units in memory </entry>
<entry> "<literal>systemctl list-timers</literal>" </entry>
</row>
<row>
<entry> Start "<literal>$unit</literal>" </entry>
<entry> "<literal>systemctl start $unit</literal>" </entry>
</row>
<row>
<entry> Stop "<literal>$unit</literal>" </entry>
<entry> "<literal>systemctl stop $unit</literal>" </entry>
</row>
<row>
<entry> Reload service-specific configuration </entry>
<entry> "<literal>systemctl reload $unit</literal>" </entry>
</row>
<row>
<entry> Stop and start all "<literal>$unit</literal>" </entry>
<entry> "<literal>systemctl restart $unit</literal>" </entry>
</row>
<row>
<entry> Start "<literal>$unit</literal>" and stop all others </entry>
<entry> "<literal>systemctl isolate $unit</literal>" </entry>
</row>
<row>
<entry> Switch to "<literal>graphical</literal>" (GUI system) </entry>
<entry> "<literal>systemctl isolate graphical</literal>" </entry>
</row>
<row>
<entry> Switch to "<literal>multi-user</literal>" (CLI system) </entry>
<entry> "<literal>systemctl isolate multi-user</literal>" </entry>
</row>
<row>
<entry> Switch to "<literal>rescue</literal>" (single user CLI system) </entry>
<entry> "<literal>systemctl isolate rescue</literal>" </entry>
</row>
<row>
<entry> Send kill signal to "<literal>$unit</literal>" </entry>
<entry> "<literal>systemctl kill $unit</literal>" </entry>
</row>
<row>
<entry> Check if "<literal>$unit</literal>" service is active </entry>
<entry> "<literal>systemctl is-active $unit</literal>" </entry>
</row>
<row>
<entry> Check if "<literal>$unit</literal>" service is failed </entry>
<entry> "<literal>systemctl is-failed $unit</literal>" </entry>
</row>
<row>
<entry> Check status of "<literal>$unit|$PID|device</literal>" </entry>
<entry> "<literal>systemctl status $unit|$PID|$device</literal>" </entry>
</row>
<row>
<entry> Show properties of "<literal>$unit|$job</literal>" </entry>
<entry> "<literal>systemctl show $unit|$job</literal>" </entry>
</row>
<row>
<entry> Reset failed "<literal>$unit</literal>" </entry>
<entry> "<literal>systemctl reset-failed $unit"</literal> </entry>
</row>
<row>
<entry> List dependency of all unit services </entry>
<entry> "<literal>systemctl list-dependencies --all</literal>" </entry>
</row>
<row>
<entry> List unit files installed on the system </entry>
<entry> "<literal>systemctl list-unit-files</literal>" </entry>
</row>
<row>
<entry> Enable "<literal>$unit</literal>" (add symlink) </entry>
<entry> "<literal>systemctl enable $unit</literal>" </entry>
</row>
<row>
<entry> Disable "<literal>$unit</literal>" (remove symlink) </entry>
<entry> "<literal>systemctl disable $unit</literal>" </entry>
</row>
<row>
<entry> Unmask "<literal>$unit</literal>" (remove symlink to "<literal>/dev/null</literal>") </entry>
<entry> "<literal>systemctl unmask $unit</literal>" </entry>
</row>
<row>
<entry> Mask "<literal>$unit</literal>" (add symlink to "<literal>/dev/null</literal>") </entry>
<entry> "<literal>systemctl mask $unit</literal>" </entry>
</row>
<row>
<entry> Get default-target setting </entry>
<entry> "<literal>systemctl get-default</literal>" </entry>
</row>
<row>
<entry> Set default-target to "<literal>graphical</literal>" (GUI system) </entry>
<entry> "<literal>systemctl set-default graphical</literal>" </entry>
</row>
<row>
<entry> Set default-target to "<literal>multi-user</literal>" (CLI system) </entry>
<entry> "<literal>systemctl set-default multi-user</literal>" </entry>
</row>
<row>
<entry> Show job environment </entry>
<entry> "<literal>systemctl show-environment</literal>" </entry>
</row>
<row>
<entry> Set job environment "<literal>variable</literal>" to "<literal>value</literal>" </entry>
<entry> "<literal>systemctl set-environment variable=value</literal>" </entry>
</row>
<row>
<entry> Unset job environment "<literal>variable</literal>" </entry>
<entry> "<literal>systemctl unset-environment variable</literal>" </entry>
</row>
<row>
<entry> Reload all unit files and daemons </entry>
<entry> "<literal>systemctl daemon-reload</literal>" </entry>
</row>
<row>
<entry> Shut down the system </entry>
<entry> "<literal>systemctl poweroff</literal>" </entry>
</row>
<row>
<entry> Shut down and reboot the system </entry>
<entry> "<literal>systemctl reboot</literal>" </entry>
</row>
<row>
<entry> Suspend the system </entry>
<entry> "<literal>systemctl suspend</literal>" </entry>
</row>
<row>
<entry> Hibernate the system </entry>
<entry> "<literal>systemctl hibernate</literal>" </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Here, "<literal>$unit</literal>" in the above examples may be a single unit name (suffix such as <literal>.service</literal> and <literal>.target</literal> are optional) or, in many cases, multiple unit specifications (shell-style globs "<literal>*</literal>", "<literal>?</literal>", "<literal>[]</literal>" using <literal>fnmatch</literal>(3) which will be matched against the primary names of all units currently in memory).</para>
<para>System state changing commands in the above examples are typically preceded by the "<literal>sudo</literal>" to attain the required administrative privilege.</para>
<para>The output of the "<literal>systemctl status $unit|$PID|$device</literal>" uses color of the dot ("●") to summarize the unit state at a glance.</para>
<itemizedlist>
<listitem> <para> White "●" indicates an "inactive" or "deactivating" state. </para> </listitem>
<listitem> <para> Red "●" indicates a "failed" or "error" state. </para> </listitem>
<listitem> <para> Green "●" indicates an "active", "reloading" or "activating" state. </para> </listitem>
</itemizedlist>
</section>
<section id="_other_system_monitors">
<title>Other system monitors</title>
<para>Here are a list of other monitoring command snippets under <literal>systemd</literal>. Please read the pertinent manpages including <literal>cgroups</literal>(7).</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of other monitoring command snippets under <literal>systemd</literal></title>
<tgroup cols="2">
<colspec colwidth="341pt" align="left"/>
<colspec colwidth="320pt" align="left"/>
<thead>
<row>
<entry> Operation </entry>
<entry> Command snippets </entry>
</row>
</thead>
<tbody>
<row>
<entry> Show time spent for each initialization steps </entry>
<entry> "<literal>systemd-analyze time</literal>" </entry>
</row>
<row>
<entry> List of all units by the time to initialize </entry>
<entry> "<literal>systemd-analyze blame</literal>" </entry>
</row>
<row>
<entry> Load and detect errors in "<literal>$unit</literal>" file </entry>
<entry> "<literal>systemd-analyze verify $unit</literal>" </entry>
</row>
<row>
<entry> Show terse runtime status information of the user of the caller's session </entry>
<entry> "<literal>loginctl user-status</literal>" </entry>
</row>
<row>
<entry> Show terse runtime status information of the caller's session </entry>
<entry> "<literal>loginctl session-status</literal>" </entry>
</row>
<row>
<entry> Track boot process by the <ulink url="https://en.wikipedia.org/wiki/Cgroups">cgroups</ulink> </entry>
<entry> "<literal>systemd-cgls</literal>" </entry>
</row>
<row>
<entry> Track boot process by the <ulink url="https://en.wikipedia.org/wiki/Cgroups">cgroups</ulink> </entry>
<entry> "<literal>ps xawf -eo pid,user,cgroup,args</literal>" </entry>
</row>
<row>
<entry> Track boot process by the <ulink url="https://en.wikipedia.org/wiki/Cgroups">cgroups</ulink> </entry>
<entry> Read <ulink url="https://en.wikipedia.org/wiki/Sysfs">sysfs</ulink> under "<literal>/sys/fs/cgroup/</literal>" </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="_system_configuration">
<title>System configuration</title>
<section id="_the_hostname">
<title>The hostname</title>
<para>The kernel maintains the system <emphasis role="strong">hostname</emphasis>. The system unit started by <literal>systemd-hostnamed.service</literal> sets the system hostname at boot time to the name stored in "<literal>/etc/hostname</literal>". This file should contain <emphasis role="strong">only</emphasis> the system hostname, not a fully qualified domain name.</para>
<para>To print out the current hostname run <literal>hostname</literal>(1) without an argument.</para>
</section>
<section id="_the_filesystem">
<title>The filesystem</title>
<para>The mount options of normal disk and network filesystems are set in "<literal>/etc/fstab</literal>". See <literal>fstab</literal>(5) and <xref linkend="_optimization_of_filesystem_by_mount_options"/>.</para>
<para>The configuration of the encrypted filesystem is set in "<literal>/etc/crypttab</literal>". See <literal>crypttab</literal>(5)</para>
<para>The configuration of software RAID with <literal>mdadm</literal>(8) is set in "<literal>/etc/mdadm/mdadm.conf</literal>". See <literal>mdadm.conf</literal>(5).</para>
<warning>
<para>After mounting all the filesystems, temporary files in "<literal>/tmp</literal>", "<literal>/var/lock</literal>", and "<literal>/var/run</literal>" are cleaned for each boot up.</para>
</warning>
</section>
<section id="_network_interface_initialization">
<title>Network interface initialization</title>
<para>Network interfaces are typically initialized in "<literal>networking.service</literal>" for the <literal>lo</literal> interface and "<literal>NetworkManager.service</literal>" for other interfaces on modern Debian desktop system under <literal>systemd</literal>.</para>
<para>See <xref linkend="_network_setup"/> for how to configure them.</para>
</section>
<section id="_cloud_system_initialization">
<title>Cloud system initialization</title>
<para>The cloud system instance may be launched as a clone of <ulink url="https://cloud.debian.org/images/cloud/">"Debian Official Cloud Images"</ulink> or similar images. For such system instance, personalities such as hostname, filesystem, networking, locale, SSH keys, users and groups may be configured using functionalities provided by <literal>cloud-init</literal> and <literal>netplan.io</literal> packages with multiple data sources such as files placed in the original system image and external data provided during its launch. These packages enable the declarative system configuration using <ulink url="https://en.wikipedia.org/wiki/YAML">YAML</ulink> data.</para>
<para>See more at <ulink url="https://wiki.debian.org/Cloud/">"Cloud Computing with Debian and its descendants"</ulink>, <ulink url="https://cloudinit.readthedocs.io/en/latest/index.html">"Cloud-init documentation"</ulink> and <xref linkend="_the_modern_network_configuration_for_cloud"/>.</para>
</section>
<section id="_customization_example_to_tweak_sshd_service">
<title>Customization example to tweak sshd service</title>
<para>With default installation, many network services (see <xref linkend="_network_applications"/>) are started as daemon processes after <literal>network.target</literal> at boot time by <literal>systemd</literal>. The "<literal>sshd</literal>" is no exception. Let's change this to on-demand start of "<literal>sshd</literal>" as a customization example.</para>
<para>First, disable system installed service unit.</para>
<screen> $ sudo systemctl stop sshd.service
$ sudo systemctl mask sshd.service</screen>
<para>The on-demand socket activation system of the classic Unix services was through the <literal>inetd</literal> (or <literal>xinetd</literal>) superserver. Under <literal>systemd</literal>, the equivalent can be enabled by adding <emphasis role="strong">*.socket</emphasis> and <emphasis role="strong">*.service</emphasis> unit configuration files.</para>
<para><literal>sshd.socket</literal> for specifying a socket to listen on</para>
<screen>[Unit]
Description=SSH Socket for Per-Connection Servers
[Socket]
ListenStream=22
Accept=yes
[Install]
WantedBy=sockets.target</screen>
<para><literal>sshd@.service</literal> as the matching service file of <literal>sshd.socket</literal></para>
<screen>[Unit]
Description=SSH Per-Connection Server
[Service]
ExecStart=-/usr/sbin/sshd -i
StandardInput=socket</screen>
<para>Then reload.</para>
<screen> $ sudo systemctl daemon-reload</screen>
</section>
</section>
<section id="_the_udev_system">
<title>The udev system</title>
<para>The <ulink url="https://en.wikipedia.org/wiki/Udev">udev system</ulink> provides mechanism for the automatic hardware discovery and initialization (see <literal>udev</literal>(7)) since Linux kernel 2.6. Upon discovery of each device by the kernel, the udev system starts a user process which uses information from the <ulink url="https://en.wikipedia.org/wiki/Sysfs">sysfs</ulink> filesystem (see <xref linkend="_procfs_and_sysfs"/>), loads required kernel modules supporting it using the <literal>modprobe</literal>(8) program (see <xref linkend="_the_kernel_module_initialization"/>), and creates corresponding device nodes.</para>
<tip>
<para>If "<literal>/lib/modules/<emphasis>kernel-version</emphasis>/modules.dep</literal>" was not generated properly by <literal>depmod</literal>(8) for some reason, modules may not be loaded as expected by the udev system. Execute "<literal>depmod -a</literal>" to fix it.</para>
<para>For mounting rules in "<literal>/etc/fstab</literal>", device nodes do not need to be static ones. You can use <ulink url="https://en.wikipedia.org/wiki/Universally_Unique_Identifier">UUID</ulink> to mount devices instead of device names such as "<literal>/dev/sda</literal>". See <xref linkend="_accessing_partition_using_uuid"/>.</para>
</tip>
<para>Since the udev system is somewhat a moving target, I leave details to other documentations and describe the minimum information here.</para>
<warning>
<para>Don't try to run long running programs such as backup script with <literal>RUN</literal> in udev rules as mentioned in <literal>udev</literal>(7). Please create a proper <literal>systemd.service</literal>(5) file and activate it, instead. See <xref linkend="_mount_event_triggered_backup" />. </para>
</warning>
</section>
<section id="_the_kernel_module_initialization">
<title>The kernel module initialization</title>
<para>The <literal>modprobe</literal>(8) program enables us to configure running Linux kernel from user process by adding and removing kernel modules. The udev system (see <xref linkend="_the_udev_system"/>) automates its invocation to help the kernel module initialization.</para>
<para>There are non-hardware modules and special hardware driver modules as the following which need to be pre-loaded by listing them in the "<literal>/etc/modules</literal>" file (see <literal>modules</literal>(5)).</para>
<itemizedlist>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/TUN/TAP">TUN/TAP</ulink> modules providing virtual Point-to-Point network device (TUN) and virtual Ethernet network device (TAP), </para> </listitem>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/Netfilter">netfilter</ulink> modules providing netfilter firewall capabilities (<literal>iptables</literal>(8), <xref linkend="_netfilter_infrastructure"/>), and </para> </listitem>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/Watchdog_timer">watchdog timer</ulink> driver modules. </para> </listitem>
</itemizedlist>
<para>The configuration files for the <literal>modprobe</literal>(8) program are located under the "<literal>/etc/modprobes.d/</literal>" directory as explained in <literal>modprobe.conf</literal>(5). (If you want to avoid some kernel modules to be auto-loaded, consider to blacklist them in the "<literal>/etc/modprobes.d/blacklist</literal>" file.)</para>
<para>The "<literal>/lib/modules/<emphasis>version</emphasis>/modules.dep</literal>" file generated by the <literal>depmod</literal>(8) program describes module dependencies used by the <literal>modprobe</literal>(8) program.</para>
<note> <para>If you experience module loading issues with boot time module loading or with <literal>modprobe</literal>(8), "<literal>depmod -a</literal>" may resolve these issues by reconstructing "<literal>modules.dep</literal>".</para> </note>
<para>The <literal>modinfo</literal>(8) program shows information about a Linux kernel module.</para>
<para>The <literal>lsmod</literal>(8) program nicely formats the contents of the "<literal>/proc/modules</literal>", showing what kernel modules are currently loaded.</para>
<tip>
<para>You can identify exact hardware on your system. See <xref linkend="_hardware_identification"/>.</para>
<para>You may configure hardware at boot time to activate expected hardware features. See <xref linkend="_hardware_configuration"/>.</para>
<para>You can probably add support for your special device by recompiling the kernel. See <xref linkend="_the_kernel"/>.</para>
</tip>
</section>
</chapter>
|