Skip to content

systemctl

19 commands

Controls systemd: start, stop, enable and inspect services, timers and the boot target.

  • services
  • systemd
  • persistence

Services8

systemctl status <unit>

State, main PID, memory use and the latest log lines for a service.

Link
sudo systemctl start <unit>

Starts a service now.

Link
sudo systemctl stop <unit>

Stops a service.

Link
sudo systemctl restart <unit>

Stops and starts it again.

Link
sudo systemctl reload <unit>

Reloads configuration without dropping connections, if the service supports it.

Link
sudo systemctl enable --now <unit>

Starts the service and makes it start at boot.

Link
sudo systemctl disable --now <unit>

Stops it and removes it from boot.

Link
sudo systemctl mask <unit>

Prevents a unit from being started at all, even as a dependency.

Link

Inspecting7

systemctl list-units --type=service --state=running

Every running service.

Link
systemctl list-unit-files --state=enabled

Everything set to start at boot — a key persistence check.

Link
systemctl --failed

Units that failed to start.

Link
systemctl list-timers --all

systemd timers, the modern replacement for cron and another persistence location.

Link
systemctl cat <unit>

Prints the unit file plus any drop-in overrides.

Link
systemctl show <unit> -p ExecStart,User,FragmentPath

Specific properties: the command it runs, the user and where the unit file lives.

Link
systemctl list-dependencies <unit>

What a unit pulls in.

Link

Editing and system4

sudo systemctl edit <unit>

Creates a drop-in override instead of editing the vendor unit file.

Link
sudo systemctl daemon-reload

Reloads unit files after you change them.

Link
systemctl --user list-units

Per-user services, which run without root and are easy to overlook.

Link
systemctl get-default

The target the system boots into (graphical or multi-user).

Link