Pcornel
Linux · systemd & Services

Targets

Cheat sheet · https://pcornel.dk/topic.php?topic=2720

Back to the Topic

Answer

A target is a systemd unit that groups other units into a system state, such as multi-user.target (normal server) and graphical.target (desktop). It replaces SysV runlevels.

Remember

Services start at boot if they are wanted by the default target (WantedBy=multi-user.target and systemctl enable). systemctl get-default shows the boot target; systemctl isolate switches now.

First checks

  • systemctl status <unit> — state, main PID, recent log lines
  • systemctl list-units --failed — failed units
  • journalctl -u <unit> -b — the unit's log since boot
  • systemctl cat <unit> — unit file plus drop-ins
  • systemd-analyze verify <unit> — unit file errors

Verify in this order

boot → default target → its Wants/Requires pulled in → units started in dependency order

Where it usually breaks

First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2720

Confirmation

Confirm action

Continue?