Introduction
In this challenge, you will learn how to configure services to start automatically at system boot on a systemd-based system. While the standard command systemctl is typically used for this, it is not available in all environments, such as containers. You will learn the underlying mechanism that systemctl uses, which involves creating symbolic links. This knowledge is essential for system administrators to ensure critical services are enabled, especially when working in restricted environments.
Configure Services to Start Automatically at Boot
Description
On this RHEL 9 system, networking is managed by NetworkManager.service rather than the legacy network.service. Enabling a service for boot-time startup involves creating a symbolic link from a target's wants directory to the service's unit file. Your task is to manually enable the NetworkManager and sshd services by creating the necessary symbolic links in multi-user.target.
Tasks
- Enable the
NetworkManagerservice to start automatically at boot. - Enable the
sshdservice to start automatically at boot.
Requirements
- You must create a symbolic link for
NetworkManager.serviceinside the/etc/systemd/system/multi-user.target.wants/directory. The link must point to the source unit file located at/usr/lib/systemd/system/NetworkManager.service. - You must create a symbolic link for
sshd.serviceinside the/etc/systemd/system/multi-user.target.wants/directory. The link must point to the source unit file located at/usr/lib/systemd/system/sshd.service. - All operations must be performed with
sudoprivileges. - All commands must be executed from the home directory (
~/).
Example
After completing this challenge, the output of the ls -l /etc/systemd/system/multi-user.target.wants/ command, when filtered for NetworkManager and sshd, should look similar to the following. This indicates that both services are enabled.
lrwxrwxrwx. 1 root root 46 Jul 10 12:00 NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
lrwxrwxrwx. 1 root root 36 Jul 10 12:01 sshd.service -> /usr/lib/systemd/system/sshd.service
Summary
In this challenge, you have learned the underlying mechanism for enabling services to start at boot in a systemd-based Linux distribution. You manually created symbolic links for the NetworkManager and sshd services, replicating the action of the systemctl enable command. This skill is particularly valuable for system administration in environments where standard tools may be unavailable, enhancing your understanding of systemd's operation and improving your troubleshooting capabilities.



