How to remove missing systemd units?

Solution 1:

The command you're after is systemctl reset-failed

Solution 2:

When systemd analyzes unit definition files, it takes note of any other related units called out in the file - whether those other units exist or not.

$ systemctl --state=not-found --all
> ( ...prints list of 'not-found' units )

$ grep -r "<missing-unit>" /usr/lib/systemd/system
> ( returns files with references to <missing-unit> )

When a unit shows up as "not-found", it's not necessarily an error - all we know is, a local unit definition claims to have some relationship with it. This relationship might not be one we care about. For example, it could be "Before:" some other unit, but we don't use that other unit.

Tags:

Systemd

Coreos