Fwd: Systemctl thinks a service file exists that does not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Forgot again to change the To. :'-{

---------- Forwarded message ---------
Van: Cecil Westerhof <cldwesterhof@xxxxxxxxx>
Date: ma 28 aug 2023 om 13:56
Subject: Re: Systemctl thinks a service file exists that does not
To: Andrei Borzenkov <arvidjaar@xxxxxxxxx>


Op ma 28 aug 2023 om 13:30 schreef Andrei Borzenkov <arvidjaar@xxxxxxxxx>:
On Mon, Aug 28, 2023 at 1:50 PM Cecil Westerhof <cldwesterhof@xxxxxxxxx> wrote:
>
> Op ma 28 aug 2023 om 11:55 schreef Andrei Borzenkov <arvidjaar@xxxxxxxxx>:
>>
>> On Mon, Aug 28, 2023 at 12:27 PM Cecil Westerhof <cldwesterhof@xxxxxxxxx> 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

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux