Lab activity

Manage System Boot Targets

Learn how to manage systemd boot targets by switching between active targets, configuring the default boot target, and troubleshooting target-related issues.

Overview

In this lab, you will learn how to manage systemd boot targets and understand how they control the system's operating state. You will inspect active targets, switch between graphical.target and multi-user.target while the system is running, and configure the persistent default target used during boot. You will also examine rescue.target and emergency.target without entering them, reboot to verify a persistent target change, restore the original configuration, and use systemd jobs and journal logs to troubleshoot target-related issues.

Learning Outcomes

  • Understand the purpose of systemd targets and their relationship to traditional SysV runlevels.
  • Identify the currently active and default systemd targets.
  • Switch the running system between targets using systemctl isolate.
  • Configure the persistent boot target using systemctl set-default.
  • Understand the differences between multi-user.target, graphical.target, rescue.target, and emergency.target.
  • Verify that a configured default target is applied after a reboot.
  • Restore the original boot target configuration.
  • Use systemd jobs and journal logs to troubleshoot target and boot issues.

Key Concepts

  • systemd Target: A logical group of system units that defines a particular operating state of the system.
  • multi-user.target: A full multi-user, text-mode operating state commonly associated with the traditional runlevel 3.
  • graphical.target: A multi-user operating state that also includes graphical services and is commonly associated with runlevel 5.
  • rescue.target: A minimal single-user recovery environment used for system troubleshooting and repair.
  • emergency.target: An even more minimal recovery environment intended for critical system recovery.
  • systemctl isolate: Immediately switches the running system to a specified target without rebooting.
  • systemctl set-default: Changes the target that systemd will use during future boots.
  • systemctl get-default: Displays the currently configured persistent default target.

Why Needed?

  • Controls System State: Allows administrators to choose which services and system components should be active.
  • Manages Boot Behavior: Configures the operating state that the system enters automatically after boot.
  • Supports System Recovery: Provides specialized targets for troubleshooting and repairing systems.
  • Enables Live Changes: Allows administrators to switch between operating states without rebooting when appropriate.
  • Improves Troubleshooting: Systemd job information and journal logs help identify problems during target transitions and boot.