1

I have a shell environment library where I maintain all types of checks and helpers functions for my bash/zsh environments (Linux and macOS). I like that periodic checks automatically inspect my OS' functionalities so that I don't forget certain things and always keep everything fresh.

Today I was running some service things on my Raspberry and when listing all services with systemctl list-units --type=service --all I noticed some failures and not-found entries. The failures were easy to clean because they were non-well-cleaned old pihole and vsftpd service files. But how should I approach the not-found ones? Are there certain ones to simply ignore or generate basic service files for them?

pi@raspberrypi [130] % systemctl list-units --type=service --all | grep "not-found"
● auditd.service                  not-found inactive dead    auditd.service
● console-screen.service          not-found inactive dead    console-screen.service
● exim4.service                   not-found inactive dead    exim4.service
● firewalld.service               not-found inactive dead    firewalld.service
● gssproxy.service                not-found inactive dead    gssproxy.service
● kbd.service                     not-found inactive dead    kbd.service
● mountkernfs.service             not-found inactive dead    mountkernfs.service
● NetworkManager.service          not-found inactive dead    NetworkManager.service
● nfs-blkmap.service              not-found inactive dead    nfs-blkmap.service
● nfs-server.service              not-found inactive dead    nfs-server.service
● nslcd.service                   not-found inactive dead    nslcd.service
● sendmail.service                not-found inactive dead    sendmail.service
● sssd.service                    not-found inactive dead    sssd.service
● systemd-update-done.service     not-found inactive dead    systemd-update-done.service
● systemd-vconsole-setup.service  not-found inactive dead    systemd-vconsole-setup.service
● ypbind.service                  not-found inactive dead    ypbind.service

1 Answer 1

2

Units in not-found state only show up if they're not inactive or if something depends on them.

If the unit is "not-found" but "active", it means the package has been uninstalled but didn't stop the corresponding units. Stop them manually (or reboot).

If the unit is "failed", it's there so that you could inspect the failure. After doing so, systemctl reset-failed will remove it.

If the unit is "not-found" and "inactive" yet stays in the list, then it's probably wanted or required by another unit. For example, the unit is probably still "enabled", i.e. your /etc/systemd/system/*.target.wants contains a symlink to it. Remove the links either manually or using systemctl disable. It could also be that you started something that lists it as Wants= or Requires= the nonexistent service (having a Wants= on nonexistent units is perfectly fine; it's an "optional dependency").

2
  • When I search for example for grep -ir "audit" /etc/systemd it only finds /etc/systemd/journald.conf:#Audit=no and most others find nothing. What might be another explanation that they exist? I also noticed my cleanly installed DigitalOcean Droplets also have some of those. I don't mind ignoring them, but I was just curious where to find them. Are there other places to look for references?
    – Fëanorson
    Commented Nov 29, 2022 at 13:08
  • I found this for example for auditd; /etc/sv/ssh/run:sv start auditd || sv check auditd || true.
    – Fëanorson
    Commented Nov 29, 2022 at 13:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .