[systemd-devel] Fwd: Systemctl thinks a service file exists that does not

Cecil Westerhof cldwesterhof at gmail.com
Mon Aug 28 12:31:03 UTC 2023


Forgot again to change the To. :'-{

---------- Forwarded message ---------
Van: Cecil Westerhof <cldwesterhof at gmail.com>
Date: ma 28 aug 2023 om 13:56
Subject: Re: [systemd-devel] Systemctl thinks a service file exists that
does not
To: Andrei Borzenkov <arvidjaar at gmail.com>


Op ma 28 aug 2023 om 13:30 schreef Andrei Borzenkov <arvidjaar at gmail.com>:

> On Mon, Aug 28, 2023 at 1:50 PM Cecil Westerhof <cldwesterhof at gmail.com>
> wrote:
> >
> > Op ma 28 aug 2023 om 11:55 schreef Andrei Borzenkov <arvidjaar at gmail.com
> >:
> >>
> >> On Mon, Aug 28, 2023 at 12:27 PM Cecil Westerhof <
> cldwesterhof at gmail.com> wrote:
> >> >
> >> > On debian 12, when Itype:
> >> >     systemctl status spam
> >> >
> >> > and giving a tab I get:
> >> >     spamassassin-maintenance.service  spamassassin.service
> >> >     spamassassin-maintenance.timer    spamd.service
> >> >
> >> > Still:
> >> >     systemctl start spamassassin.service
> >> >
> >> > keeps giving not found.
> >> >
> >>
> >> Those units are probably listed as dependencies somewhere. Units
> >> listed in Wants or After/Before are not required to exist.
> >>
> >> > So systemctl thinks there is a spamassassin.service file, but when
> >> > starting it does not find it.
> >> >
> >> > I do not find a spamassassin.service file on my system. The other
> >> > three I do find.
> >> >
> >> > When using:
> >> >     find / -name spamassassin.service
> >> >
> >> > it does not find spamassassin.service.
> >> > So why does systemctl think there is a spamassassin.service?
> >>
> >> It is not the systemctl, it is your shell completion of the systemctl.
> >> Just look at the output of "systemctl list-units --all" for
> >> "not-found".
> >
> >
> > I have to clean up my system: there are 25 not-found services, 3
> not-found targets, 2 not-found mounts and 1 not-found socket.
> >
> > For spamassassin.service I see:
> >     ● spamassassin.service
>                                              not-found inactive dead
> spamassassin.service
> >
> > But when I give:
> >     systemctl list-dependencies spamassassin.service
> >
> > I get:
> >     spamassassin.service
> >
> > I looked into:
> >     /etc/systemd/system
> >     /run/systemd/system
> >     /lib/systemd/system
> > But I do not find dependencies.
> >
> > Where else should I look?
> >
>
> Look at "systemctl show spamassassin.service".
>

That gave:
    Before=exim4.service

Exim4 was not installed, but there was a /etc/init.d/exim4. After removing
that it was OK. Tab does not produce spamassassin.service anymore.

Now I have to do the same work for the other unit files that give a
not-found.

Thanks.


>
> >> Maybe completion should skip missing units. At least for such actions
> >> as "status" this does not look useful.
> >>
> >> > And how do I make it forget it?
> >> >
> >>
> >> systemd cannot forget them as long as units depending on them are still
> loaded.
>

-- 
Cecil Westerhof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230828/8eb69c4a/attachment.htm>


More information about the systemd-devel mailing list