Unit files, timers, and daemon reload
Know where systemd configuration lives and when systemd must reread it.
systemctl list-timers
25 min read, 35 min lab
operator
Unit files define services, timers, mounts, sockets, and more. Editing a unit file requires `systemctl daemon-reload` before systemd sees the change. Timers are scheduled unit triggers, not cron clones.
A timer should run a cleanup service every hour, but the new unit edit is ignored.
Worked command
$ systemctl cat backup.timer$ systemctl list-timers --all$ sudo systemctl daemon-reload$ systemd-analyze verify ./backup.service
Do not edit units and restart blindly without daemon-reload and validation.
Validate unit shape, reload systemd, then restart or enable the unit.
You edited a unit file and ran `systemctl restart` on it, but your change is ignored. Why?
Show the answer
Correct: A. systemd still holds the old unit; you must daemon-reload first
systemd caches unit definitions in memory; `systemctl daemon-reload` makes it reread the file, then restart applies it. A reboot would also work but is overkill, and `reload` asks the running service to reload its own config, not systemd to reread the unit.
Practice checklist
- Read `systemctl cat` for an existing unit.
- List timers.
- Use sample unit text with `systemd-analyze verify` if available.
Deliverable evidence
- Unit path, timer state, and reload/verify note.
shows: Active, enabled, logs, and unit-file are four independent questions, and that a unit edit needs daemon-reload before systemd acts on it.
does not prove: It shows which checks to run, not their results: a green "active" box is a snapshot, not proof the service is healthy or will survive the next reboot.
Commit these to memory, then drill them until recall is automatic.
cue Edited a unit file; make systemd reread it before restarting
show recall target
sudo systemctl daemon-reload