LFCS Certification System Service Management (systemd) 3 — Questions and Answers
Question 1: Which command would you use to reload systemd's unit file configuration from disk without rebooting?
- systemctl reload
- systemctl daemon-reload (Correct answer)
- systemctl restart systemd
- systemd-reload
Correct answer: systemctl daemon-reload
`systemctl daemon-reload` re-reads all unit files and regenerates dependency trees; it must be run after any unit file modification.
Question 2: A timer unit `backup.timer` is set to activate `backup.service`. Where must the timer unit be enabled for it to fire at boot?
- The service file must have OnCalendar= set
- The timer unit itself must be enabled and started with systemctl enable --now backup.timer (Correct answer)
- The service unit must have a [Timer] section
- Timers start automatically when the associated service is enabled
Correct answer: The timer unit itself must be enabled and started with systemctl enable --now backup.timer
Timer units must be enabled and started independently; enabling the associated service does not activate the timer.
Question 3: Which directive limits the amount of CPU time a systemd service can use, expressed as a percentage of one CPU core?
- CPUQuota= (Correct answer)
- CPULimit=
- CPUShare=
- CPUTime=
Correct answer: CPUQuota=
`CPUQuota=50%` restricts the service to using no more than 50% of a single CPU core via the cgroup CPU controller.
Question 4: You need to temporarily override a vendor unit file without modifying it directly. Which approach is recommended?
- Edit the file in /lib/systemd/system/
- Create a drop-in file in /etc/systemd/system/<unit>.d/override.conf (Correct answer)
- Copy the unit to /run/systemd/system/ and edit it
- Use systemctl modify to append directives
Correct answer: Create a drop-in file in /etc/systemd/system/<unit>.d/override.conf
Drop-in files in `/etc/systemd/system/<unit>.d/` are merged with the vendor unit file, letting you override specific directives without touching the original.
Question 5: What does `systemctl isolate rescue.target` do?
- Reboots the system into rescue mode on next boot
- Immediately switches to rescue.target, stopping all units not required by it (Correct answer)
- Adds rescue.target as a fallback boot option
- Enables the rescue.target unit permanently
Correct answer: Immediately switches to rescue.target, stopping all units not required by it
`isolate` starts the specified target and stops all units not pulled in by that target, effectively switching runlevels immediately.
Question 6: Which journal command shows only kernel messages, similar to `dmesg`?
- journalctl -k (Correct answer)
- journalctl --kernel
- journalctl -u kernel
- journalctl --dmesg
Correct answer: journalctl -k
`journalctl -k` (or `--dmesg`) filters the journal to show only kernel ring buffer messages.
Question 7: In a systemd unit file, what is the effect of setting `PrivateTmp=yes` in the [Service] section?
- The service uses an in-memory tmpfs for all writes
- The service gets its own private /tmp and /var/tmp namespaced away from other processes (Correct answer)
- Temporary files created by the service are deleted on exit
- The service is denied write access to /tmp
Correct answer: The service gets its own private /tmp and /var/tmp namespaced away from other processes
`PrivateTmp=yes` mounts a private, isolated tmpfs for /tmp and /var/tmp visible only to that service, improving security isolation.
Which command would you use to reload systemd's unit file configuration from disk without rebooting?