A service has two states, and the machine reports on each one separately. This step covers what they mean.
Services are managed by systemd: it starts them at boot and stops or restarts them on command. Everything it manages is called a unit. A service is a unit whose name ends in .service: cron.service, nginx.service. In systemctl commands you can leave the ending out; to it, cron and cron.service are the same service.
The two states do not depend on each other:
active— the service is running now.systemctl is-activeprints it:active— running,inactive— stopped,failed— ended with a failure.enabled— the service starts when the system boots; this is called autostart.systemctl is-enabledprints it:enabled— on,disabled— off.
The summary of a service shows both states too:
On the Loaded line, after the path to the unit file, comes enabled or disabled — that is autostart. The preset: enabled next to it is the autostart setting the Ubuntu package installs the service with; it has no effect on how the service runs. The Active line is about running now: active (running) and the start time. The warning Warning: some journal files were not opened means that student cannot read the service's journal without sudo; the next lesson is about the journal.
systemctl status nginx prints these lines. What happens to nginx after a reboot?
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: failed (Result: signal) since Sun 2026-10-18 17:06:37 UTC; 1s ago
-
loadedat the start of theLoadedline means systemd has read the unit file, and its path is right there. -
failedon theActiveline is about running now: nginx ended with a failure. Autostart is on theLoadedline, and it saysenabled. -
After the failure the
Loadedline still saysenabled: a failure changes running now, autostart stays as it was.
enabled on the Loaded line means systemd starts nginx at boot. failed on the Active line says just that nginx is down right now after a failure.
Key points
- active means the service runs now, enabled means it starts at boot; neither follows from the other.
-
systemctl is-activeandsystemctl is-enabledprint one state each,systemctl statusprints both.