haase.dev/ blog

Systemd Degraded

July 18, 2020

The Icinga check showed systemd status as degraded, so lets verify:

❯ systemctl status
● sateda
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
   ...

Print failed services with systemctl --failed.

❯ systemctl --failed
  UNIT                   LOAD   ACTIVE SUB    DESCRIPTION
● wg-quick@infra.service loaded failed failed WireGuard via wg-quick(8) for infra

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

In this case the service was no longer available, so a reset would fix the problem: systemctl reset-failed

reset-failed [PATTERN...]
   Reset the "failed" state of the specified units, or if no unit name is passed, reset the state of all
   units. When a unit fails in some way (i.e. process exiting with non-zero error code, terminating
   abnormally or timing out), it will automatically enter the "failed" state and its exit code and status
   is recorded for introspection by the administrator until the service is stopped/re-started or reset with
   this command.

Now the state of the system should be back to running.

❯ systemctl status
● sateda
    State: running
     Jobs: 0 queued
   Failed: 0 units
   ...