Which command checks the status of the libvirtd service?
`systemctl status libvirtd` queries systemd directly for the unit's runtime state, reporting whether libvirtd is active, inactive or failed, plus recent log lines. This satisfies the stem's requirement to check service status on a systemd-managed host, unlike `service` or `virsh` alternatives that query different layers.
Why this answer
The command `systemctl status libvirtd` is correct because on modern Linux distributions using systemd, `systemctl` is the standard tool to query the status of a service unit. It provides detailed information including whether the service is active, its PID, recent log entries, and any dependencies. Since libvirtd is typically managed as a systemd unit, this command directly checks its runtime state.
Exam trap
The trap here is confusing legacy SysVinit commands like `service` with modern systemd commands, or assuming virsh has service management capabilities, when in fact systemctl is the correct tool for checking service status on systemd-based systems.
How to eliminate wrong answers
Option A is wrong because `service libvirtd status` is a legacy SysVinit wrapper that may not work on systemd-based systems and often redirects to systemctl but is not the native or recommended method. Option B is wrong because `libvirtd --check` is not a valid option; libvirtd does not have a `--check` flag for status verification. Option D is wrong because `virsh service-status` is not a valid virsh subcommand; virsh manages virtual machines, not host services.