Linux Labs

Packages, services, and logs / Stage 5 of 13

Systemd services: state and startup

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 6 · summary · 2 min

Summary

  • A service has two independent states: active means it runs now, enabled means it starts at boot. systemctl is-active and systemctl is-enabled print them, and systemctl status shows both.
  • start, stop and restart change running now, enable and disable change autostart, and the --now option changes both states at once.
  • Autostart is a link to the unit in multi-user.target.wants: enable creates it and disable removes it.
  • At the start of the lesson cron's autostart was off. The engineer's morning start got the service running but did not bring back the boot link, so is-enabled printed disabled.
Ubuntu 24.04
Loading…