Managing and Understanding the Boot Procedure on Red Hat Enterprise Linux
The following topics are covered in this chapter:
- Working with Systemd
- Working with GRUB 2
The following RHCSA exam objectives are covered in this chapter:
- Start and stop services and configure services to start automatically at boot
- Configure systems to boot into a specific target automatically
- Modify the system bootloader
In this chapter, you learn how the boot procedure on Red Hat Enterprise Linux is organized. We first go through a section about systemd, the overall service that takes care of starting everything on your server. In this section, you also learn how systemd targets are used to group systemd units and come to a final operational environment.
The second part of this chapter discusses GRUB2 and how to apply changes to the GRUB 2 boot loader. Troubleshooting is not a topic in this chapter; it is covered in Chapter 19, “Troubleshooting the Boot Procedure.”
“Do I Know This Already?” Quiz
The “Do I Know This Already?” quiz allows you to assess whether you should read this entire chapter thoroughly or jump to the “Exam Preparation Tasks” section. If you are in doubt about your answers to these questions or your own assessment of your knowledge of the topics, read the entire chapter. Table 18.1 lists the major headings in this chapter and their corresponding “Do I Know This Already?” quiz questions. You can find the answers in Appendix A, “Answers to the ‘Do I Know This Already?’ Quizzes and ‘Review Questions.’”
Table 18.1 “Do I Know This Already?” Section-to-Question Mapping
Foundation Topics Section
Working with Systemd
Working with GRUB 2
Which command shows all service unit files on your system that are currently loaded?
- systemctl --type=service
- systemctl --type=service --all
- systemctl --list-services
- systemctl --show-units | grep services
Which statement about systemd wants is not true?
- You can create wants by using the systemctl enable command.
- The target to which a specific want applies is agnostic of the associated wants.
- Wants are always administered in the /usr/lib/systemd/system directory.
- Each service knows to which target its wants should be added.
What is the best solution to avoid conflicts between incompatible units?
- Nothing, the unit files have defined for themselves which units they are not compatible with.
- Disable the service using systemctl disable.
- Unmask the service using systemctl unmask.
- Mask the service using systemctl mask.
Which of the following is not a valid status for systemd services?
To allow targets to be isolated, you need a specific statement in the target unit file. Which of the following describes that statement?
Which of the following is not a valid systemd unit type?
You want to find out which other systemd units have dependencies to this specific unit. Which command would you use?
- systemd list-dependencies --reverse
- systemctl list-dependencies --reverse
- systemctl status my.unit --show-deps
- systemd status my.unit --show-deps -r
What is the name of the file where you should apply changes to the GRUB 2 configuration?
After applying changes to the GRUB 2 configuration, you need to write those changes. Which of the following commands will do that for you?
- grub2 -o /boot/grub/grub.cfg
- grub2-mkconfig > /boot/grub2/grub.cfg
- grub2 > /boot/grub2/grub.cfg
- grub2-install > /boot/grub2/grub.cfg
Which of the following is not a valid command while working with units in systemctl?
- systemctl unit start
- systemctl status -l unit
- systemctl mask unit
- systemctl disable unit