11

My server shows multiple missing services. How can i delete them from Systemd? They are not-found.

systemctl -a shows: multiple not found
systemctl reset-failed shows: still shows

These (none of them are in /etc/systemd/ or /lib/systemd):

exim4.service - i use postfix, i never installed
apache2.service - i use nginx

Thanks!

5
  • Good question, I see that I have a not-found mysql service. I can find no files named mysql in /etc/systemd or /lib/systemd, nor do I find any mentions of "mysql" if I grep those directories. It's not at all clear why systemd has a reference to this service that it can't find. Mar 7, 2017 at 15:49
  • exactly! true! ... Mar 7, 2017 at 22:11
  • What distro are you using? If Debian/Ubuntu, then those might be sysv services.
    – zbyszek
    Mar 8, 2017 at 13:17
  • debian / systemd Mar 10, 2017 at 6:39
  • I have this on Debian 12 after purging "slapd" package via apt. systemd still shows slapd.service, even after I ran systemctl daemon-reload.
    – cweiske
    Nov 29, 2023 at 17:27

1 Answer 1

8

systemd tries to load all services which are mentioned in Wants=, Requires=, After=, Before=, RequiresMountsFor=, Conflicts=, Requisite=, PartOf=, …, x-systemd.requires=, x-systemd.requires-mounts-for=, systemd.unit=, SYSTEMD_WANTS=, and also symlinked in .wants and .requires and probably some other places I forgot.

The units you're seeing must be mentioned somewhere. Systemd doesn't know anything about apache2 or exim4 by itself. Note that systemd will generate "wrapper" services for sysvinit scripts.

Having those services listed in systemctl --all output is harmless. There's no need to "delete" them.

2
  • 2
    In my case, I eventually found a mysql reference in /etc/init.d/postfix on this line: # Should-Start: postgresql mysql clamav-daemon postgrey spamassassin saslauthd dovecot. I presume that must be where systemd is picking up the reference to it. Mar 8, 2017 at 14:12
  • 1
    "The units you're seeing must be mentioned somewhere.". I don't think that's true. I installed my own service+timer then stopped, disabled, and deleted the files I put in /etc/systemd/ and list-units --type service still lists the service even after daemon-reload. They go away with a reboot. It's harmless but annoying.
    – spinkus
    Nov 25, 2023 at 19:31

You must log in to answer this question.

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