[systemd-devel] No error even a Required= service does not exist
Mikko.Rapeli at bmw.de
Mikko.Rapeli at bmw.de
Mon Nov 25 13:22:49 UTC 2019
Hi,
On Mon, Nov 25, 2019 at 02:07:23PM +0100, Jörg Weinhardt wrote:
> Hi,
>
> the behavior of systemd is not quite clear to me:
> I have a service which requires another service to be started and running,
> so I use a Requires= dependency to the required service.
> But if the required service does not exist at all, there is no error message from systemd.
> e.g.
>
> Requires=xyz.service
>
> produces no complaint and starts the service even if there is no xyz.service
> Is this the normal behavior or can I configure systemd to throw an error in this case?
>
> If I write
> "Requires=xyz"
>
> there will be a message: Failed to add dependency on xyz, ignoring: Invalid argument
> Does that error mean that "xyz" is not a valid unit name?
I guess all these are by design. Maybe you need Wants instead of Requires in the service file.
See:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=
and
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Wants=
and possibly even
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=
Cheers,
-Mikko
>
> Thank you,
> Joerg
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list