Boot targets, shutting down and rebooting

Changing what a running system is doing: systemd targets and the older runlevels, how to switch between them, and how to shut down or reboot without losing the machine.

Lesson 3 of 3 in objective 101. System architecture, part of LPIC-1 Exam 101-500.

Each old name, and the target it means now. Left column, The name in the question; right column, The target it means. 0 points at poweroff.target (Halt — not 6, and confusing the two is a careless loss). 1 and single both point at rescue.target (Single-user maintenance, local filesystems mounted). 3 and runlevel3.target both point at multi-user.target (The alias is a symlink to this unit, not a second state). 5 points at graphical.target (The desktop). 6 points at reboot.target (Reboot, and init 6 does the same thing). The name in the question The target it means 0 poweroff.target Halt — not 6, and confusing the two is a careless loss 1 single rescue.target Single-user maintenance, local filesystems mounted 3 runlevel3.target multi-user.target The alias is a symlink to this unit, not a second state 5 graphical.target The desktop 6 reboot.target Reboot, and init 6 does the same thing
Each old name, and the target it means now.

Targets, and the runlevels they replaced

SysVinit had seven runlevels. 0 is halt, 1 is single-user, 6 is reboot, and 2 through 5 are multi-user states whose exact meaning varied by distribution — on Red Hat 3 was multi-user with networking and 5 was the graphical desktop, on Debian they were all much the same. The default lived in /etc/inittab, and telinit or init switched between them at runtime.

systemd replaced runlevels with targets, which are named groups of units rather than numbers: multi-user.target and graphical.target are the two you meet daily, with rescue.target and emergency.target for repair. systemctl get-default and systemctl set-default read and write the default, and systemctl isolate switches the running system to a target now. The old numeric names survive as aliases — runlevel3.target is a symlink to multi-user.target — which is why an exam question can mix the two vocabularies in one sentence.

emergency.target is the smaller of the two repair states: it starts almost nothing and gives you a shell on a read-only root. rescue.target mounts the local filesystems and starts a few basics first. Reaching either from the boot loader means editing the kernel line to add systemd.unit=rescue.target, or simply 1 or single for the old spelling.

Where unit files live, and which copy wins

A target is itself a unit file, and so is every service it pulls in, which makes the search order for unit files part of this objective rather than a detail of package management. systemd looks in /etc/systemd/system first, then /run/systemd/system, then /usr/lib/systemd/system, and the first file it finds under that name wins outright — nothing is merged and nothing is averaged. /usr/lib/systemd/system is the vendor directory, written by packages and rewritten whenever the package is upgraded, which is why editing anything in it is work you will lose. Local policy goes in /etc/systemd/system, where nothing but an administrator writes.

Replacing a whole unit file to change one line is its own maintenance problem, so there is a middle path. A .conf file under /etc/systemd/system/<unit>.d/ is a drop-in: its settings are merged onto whichever unit file won, overriding the ones it names and leaving the rest of the vendor file in force. systemctl edit UNIT creates exactly that, and systemctl cat UNIT prints the winning file with its drop-ins so you can see what the manager actually has. Neither route takes effect on its own — systemctl daemon-reload is what makes systemd reread the disk, and restarting a unit without it restarts the definition the manager is still holding.

Shutting down properly

shutdown is the polite command: it takes a time argument, warns logged-in users, stops services in order and then halts or reboots. shutdown -h now halts, shutdown -r +5 reboots in five minutes, and shutdown -c cancels a pending one. systemctl poweroff, halt and reboot do the same job on a systemd system, and the traditional halt, poweroff and reboot commands are redirected to systemctl there.

wall broadcasts a message to every logged-in terminal, which is what shutdown uses internally to warn people. acpid is the daemon that catches the power button and lid events from the firmware and decides what to do with them, so a machine that ignores its own power button usually has acpid stopped.

Two commands that both mention a target, and mean different days. systemctl isolate — Changes: The running system; Effect is: Now; Survives a reboot: No. systemctl set-default — Changes: The default target; Effect is: At the next boot; Survives a reboot: Yes systemctl isolate systemctl set-default Changes The running system The default target Effect is Now At the next boot Survives a reboot No Yes
Two commands that both mention a target, and mean different days.
systemctl get-defaultgraphical.targetsystemctl set-default multi-user.targetnext boot only — the running system has not movedsystemctl isolate multi-user.targetthat one took effect nowshutdown -r +5 "patching, back in five"Shutdown scheduled for Mon 2026-08-03 19:35:00 UTCshutdown -c
Reading the current state, changing it, and cancelling a shutdown.

Finding out what a reboot did

Switching targets and rebooting are the two operations most likely to leave a machine somewhere you did not intend, so the commands that say what happened belong beside them. journalctl reads the systemd journal: journalctl -k restricts the output to kernel messages, which is the same material dmesg prints, and -b restricts it to the current boot. Combined — journalctl -k -b — that is the kernel log for this boot and nothing else.

The -b flag counts backwards, and that is the part worth remembering: journalctl -b -1 is the boot BEFORE this one, which is the only way to read what a machine said on its way down after it has come back up. journalctl --list-boots prints the boots the journal still holds. dmesg cannot do any of this — the ring buffer is cleared at every boot, so it only ever describes the running kernel.

The same kernel messages, and only one place they survive a reboot. dmesg — Reads from: The kernel ring buffer; At a reboot: Cleared, every time; The boot before this one: Gone — it only describes the running kernel. journalctl — Reads from: The journal, on disk; At a reboot: Kept — journalctl --list-boots says how far back; The boot before this one: journalctl -b -1 dmesg journalctl Reads from The kernel ring buffer The journal, on disk At a reboot Cleared, every time Kept — journalctl --list-boots says how far back The boot before this one Gone — it only describes the running kernel journalctl -b -1
The same kernel messages, and only one place they survive a reboot.

Worth carrying in

systemctl get-default
The target this machine boots into.
systemctl isolate
Switch the running system to a target, stopping units not in it.
systemctl rescue
Drop to single-user-like maintenance with local filesystems mounted.
telinit
Change runlevel on a SysVinit system. init 6 has the same effect as a reboot.
/etc/inittab
Where the default runlevel lived before systemd.
shutdown -r +5
Reboot in five minutes, with a warning to logged-in users. -c cancels.
wall
Broadcast a message to all terminals.
acpid
Handles power-button and lid events from the firmware.
journalctl -k -b
Kernel messages from the current boot. -b -1 is the previous boot; --list-boots lists them.
/usr/lib/systemd/system
The vendor unit files, installed by packages and overwritten on upgrade.
/etc/systemd/system
Local unit files and drop-in directories. Beats the vendor copy of the same name.
systemctl daemon-reload
Reread the unit files from disk. Nothing you edited counts until this runs.

What the exam does with this

Objective
101. System architecture
Share of the exam
13.33% (the whole objective)
Questions in this lesson
15
Signed for by a person
0

Partly checked. None of the 15 questions here has been read against the cited source by a person. 15 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.

Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

Drill this lesson

A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.

Practise Boot targets, shutting down and rebooting

Questions in this lesson

Practise Boot targets, shutting down and rebooting

The rest of objective 101