Study guide
2.5 Systemd Boot Targets & Unit Management (101.3)
LPIC-1 Linux Administrator — Exam 101 101-500
Track your progress as you read
Finished sections get a check mark.
1 Exam Overview & Study Strategy
1.1 LPIC-1 101-500 Exam Structure & Blueprint 1.2 Command Line & Shell Fundamentals for Exam Success 1.3 Fill-in-the-Blank Strategies & Common Traps
2 Topic 101: System Architecture
2.1 Hardware Discovery, Sysfs, Procfs & Kernel Modules (101.1) 2.2 Udev, Dbus & Device Management (101.1) 2.3 BIOS vs. UEFI & System Boot Process (101.2) 2.4 Kernel Initialization, Initramfs & System Logs (101.2) 2.5 Systemd Boot Targets & Unit Management (101.3) 2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
3 Topic 102: Linux Installation & Boot Management
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1) 3.2 LVM & Standard Mount Point Allocation (102.1) 3.3 GRUB 2 Configuration & Troubleshooting (102.2) 3.4 Legacy GRUB & Alternative Boot Loaders (102.2) 3.5 Managing Shared Libraries & ldconfig (102.3) 3.6 Linux as a Virtualization Guest & Cloud Instances (102.6)
4 Topic 102: Package Management Systems
4.1 Debian Low-Level Package Management with dpkg (102.4) 4.2 High-Level Debian Package Management: apt, apt-get & apt-cache (102.4) 4.3 RPM Package Management with rpm (102.5) 4.4 YUM, DNF & Zypper Package Management (102.5) 4.5 Package Repositories & Integrity Verification (102.4/102.5) 4.6 Universal Linux Packages: Snap, Flatpak & AppImage (102.4/102.5)
5 Topic 103: Command Line & Text Processing
5.1 Shell Environment, Environment Variables & Aliases (103.1) 5.2 Command History, Quoting & Expansion (103.1) 5.3 Basic Text Filters: cat, head, tail, cut, paste, nl, od (103.2) 5.4 Advanced Text Filters: sort, uniq, wc, tr, split, less & Checksums (103.2) 5.5 Stream Editing with sed (103.2) 5.6 Basic File Management: cp, mv, rm, touch, mkdir, rmdir (103.3) 5.7 Archiving and Compression: tar, gzip, bzip2, xz, cpio & dd (103.3)
6 Topic 103: Streams, Processes, Regex & Vi
6.1 Standard Streams, Redirection & File Descriptors (103.4) 6.2 Pipelines, tee & xargs (103.4) 6.3 Process Monitoring: ps, top, free, watch, pgrep, pstree & uptime (103.5) 6.4 Signals, kill, Job Control, nohup, screen & tmux (103.5) 6.5 Process Priorities: nice & renice (103.6) 6.6 Regular Expressions & grep, egrep, fgrep (103.7) 6.7 vi / vim Modes, plus nano, Emacs & EDITOR Awareness (103.8)
7 Topic 104: Devices, Partitions & Filesystems
7.1 Block Devices, fdisk & gdisk (104.1) 7.2 GNU Parted & Partition Table Management (104.1) 7.3 Creating Filesystems: mkfs, ext4, XFS, VFAT/exFAT & Btrfs (104.1) 7.4 Filesystem Integrity: fsck, e2fsck, xfs_repair, xfs_fsr & xfs_db (104.2) 7.5 Monitoring Disk Usage: df, du & tune2fs (104.2) 7.6 Managing Swap Space: mkswap, swapon & swapoff (104.1/104.2)
8 Topic 104: Mounts, Permissions, Links & FHS
8.1 Mounting and Unmounting Filesystems: mount & umount (104.3) 8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3) 8.3 Standard File Permissions: chmod, chown, chgrp & umask (104.5) 8.4 Special Permissions: SUID, SGID & Sticky Bit (104.5) 8.5 Hard Links vs. Symbolic Links: ln & Inodes (104.6) 8.6 Filesystem Hierarchy Standard (FHS) & File Location (104.7)
2.5 Systemd Boot Targets & Unit Management (101.3)
Key Takeaways Explain This Topic AI
systemd is the modern PID 1 service manager in Linux, offering parallel unit startup, socket activation, and explicit dependency modeling.
Systemd manages 11 distinct unit types: .service, .target, .socket, .mount, .automount, .swap, .device, .timer, .path, .slice, and .scope.
Unit configuration files follow strict precedence: /etc/systemd/system/ (admin overrides) > /run/systemd/system/ (runtime) > /lib/systemd/system/ (vendor defaults).
System operating states are defined by targets: rescue.target (single-user), multi-user.target (CLI server), and graphical.target (desktop GUI).
systemctl is used for service control (start/stop/restart), enablement (enable/disable), inspection (status/is-active), masking, and changing targets (isolate, set-default).
Last updated: August 2026
2.5 Systemd Boot Targets & Unit Management
Quick Summary: systemd is the standard initialization system and service manager for modern Linux distributions. Acting as PID 1, it replaces traditional SysVinit with parallel service activation, socket- and D-Bus-based activation, and declarative unit configuration. Operating states are organized into targets (e.g., multi-user.target , graphical.target ), and all runtime service administration is performed through the systemctl command.
1. Systemd Architecture & Core Features
Unlike traditional sequential init scripts, systemd treats services and resources as structured objects called Units .
Core Systemd Capabilities
Parallel Execution : Starts non-dependent services concurrently, drastically reducing boot times.
Socket-Based Activation : Creates listening sockets (UNIX domain or TCP) before launching daemons. When a packet arrives, systemd launches the service instantly, eliminating startup race conditions.
cgroups Process Tracking : Groups service child processes inside dedicated Control Groups (cgroups). When a service stops, systemd cleanly terminates all child processes, preventing orphaned daemons.
Explicit Dependency Modeling : Uses unit directives ( Requires= , Wants= , BindsTo= , Conflicts= , Before= , After= ) to establish rigorous startup sequences.
2. The 11 Systemd Unit Types
Systemd organizes all system resources into 11 distinct unit types, distinguished by their filename extensions.
Unit Extension Resource Managed Real-World Example & Purpose
.service Daemons and background processes sshd.service , nginx.service (manages starting, stopping, restarting daemons)
.target Logical grouping of units representing a system state multi-user.target , graphical.target (replaces SysV runlevels)
.socket IPC or network sockets for on-demand daemon activation sshd.socket , cups.socket (activates .service when traffic arrives)
.mount Filesystem mount points var-log.mount (mounts /var/log ; filename must match mount path dashes)
.automount On-demand filesystem mounting upon access home-backup.automount (mounts filesystem only when directory is accessed)
.swap Swap partitions or swap files dev-nvme0n1p3.swap (activates swap space in kernel)
.device Hardware devices exposed by udev/kernel sys-subsystem-net-devices-eth0.device (enables dependency on hardware)
.timer Monotonic or calendar-based job scheduler logrotate.timer , fstrim.timer (replaces traditional cron jobs)
.path Inotify-based file/directory monitoring spool-watch.path (activates a service when a file is created or modified)
.slice Hierarchical cgroups resource partition user.slice , system.slice (manages CPU, memory, and I/O resource limits)
.scope Externally created transient processes session-1.scope (tracks user login sessions)
3. Unit File Locations & Configuration Precedence
Systemd loads unit files from three main directory locations. If unit files with identical names exist across multiple directories, systemd strictly follows a top-down priority hierarchy. [1. /etc/systemd/system/] ──► Priority 1 (Highest): Local Administrator Configuration
- │ (Custom units, modified copies, enabled symlinks)
- ▼
- [2. /run/systemd/system/] ──► Priority 2 (Intermediate): Volatile Runtime Units
- │ (Dynamically generated at boot in RAM)
- ▼
- [3. /lib/systemd/system/] ──► Priority 3 (Lowest): Vendor Package Defaults
- /usr/lib/systemd/system/ (Installed by rpm/dpkg packages; overwritten on updates)
- Drop-In Configuration Overrides ( .d/ Directories)
Instead of copying an entire 100-line vendor unit file to /etc/systemd/system/sshd.service , administrators can create a drop-in override directory named <unit>.d/ : # /etc/systemd/system/sshd.service.d/override.conf
- [Service]
- Restart=always
- RestartSec=5s
After creating or modifying unit files, you must reload the systemd manager configuration: sudo systemctl daemon-reload
Exam Trap — Unit Masking: Masking a unit renders it completely unstartable (manually or as a dependency). Systemd accomplishes this by creating a symbolic link pointing to /dev/null : sudo systemctl mask apache2
# Creates: /etc/systemd/system/apache2.service -> /dev/null
4. Systemd Targets & Operating States
A target unit ( .target ) does not run a daemon directly. Instead, it groups other unit files together using dependency symlinks located in <target_name>.wants/ and <target_name>.requires/ directories.
Standard Systemd Targets
Systemd Target SysV Equivalent Description & Operating Environment
poweroff.target Runlevel 0 Shuts down and powers off the system hardware.
rescue.target Runlevel 1 / S Single-user maintenance mode with a root shell and all local filesystems mounted read-write. No network services.
emergency.target N/A Minimal emergency shell. Root filesystem is mounted read-only , no extra services or background daemons are started.
multi-user.target Runlevel 3 Standard multi-user command-line environment with full networking and multi-user login. Default for Linux servers.
graphical.target Runlevel 5 Full multi-user environment with networking and a graphical display manager (X11 / Wayland / GDM / SDDM).
reboot.target Runlevel 6 Shuts down and reboots the system.
default.target initdefault A symbolic link pointing to the default boot target (e.g., /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target ).
Loading diagram... Systemd Target Dependency and Inheritance Hierarchy
5. System Administration with systemctl
systemctl is the central CLI utility for inspecting, controlling, enabling, and diagnosing systemd units.
Service Lifecycle Management
sudo systemctl start <unit> : Starts (activates) the unit immediately.
sudo systemctl stop <unit> : Stops (deactivates) the unit immediately.
sudo systemctl restart <unit> : Stops and restarts the unit.
sudo systemctl reload <unit> : Instructs the service to reload its configuration files without dropping active connections (e.g., nginx -s reload ).
sudo systemctl reload-or-restart <unit> : Reloads configuration if supported; otherwise, restarts the service.
Boot Enablement & State Inspection
sudo systemctl enable <unit> : Enables the unit to start at boot by creating a symlink in the target's .wants/ directory under /etc/systemd/system/ .
sudo systemctl disable <unit> : Disables automatic startup by deleting the .wants/ symlink.
sudo systemctl enable --now <unit> : Enables and immediately starts the service in a single command.
systemctl status <unit> : Displays unit state (active, inactive, failed), PID, memory usage, cgroup processes, and recent log snippets.
systemctl is-active <unit> : Returns exit code 0 and prints active if running.
systemctl is-enabled <unit> : Returns exit code 0 and prints enabled if configured for auto-start.
systemctl is-failed <unit> : Checks if the unit crashed or entered an error state.
systemctl list-units --type=service : Lists all currently loaded service units in memory.
systemctl list-unit-files : Lists all unit files installed on disk and their enablement status.
Target Operations & System Control
systemctl get-default : Queries and prints the current default boot target.
sudo systemctl set-default graphical.target : Updates the /etc/systemd/system/default.target symlink.
sudo systemctl isolate multi-user.target : Immediately switches the system state to multi-user.target , stopping all units not part of the new target.
sudo systemctl reboot : Reboots the machine.
sudo systemctl poweroff : Powers off the machine.