Re: No error even a Required= service does not exist

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

 



25.11.2019 16:19, Mantas Mikulėnas пишет:
On Mon, Nov 25, 2019 at 3:13 PM Jörg Weinhardt <jw@xxxxxxxxxxxxxxx> 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?


The docs say you can get this behavior if you also have After=xyz.service.
(Not entirely sure why.)


Because systemd dependencies are about jobs, not about units. "B Requires A" does not mean "unit B should not be active without A being active". All that it means - "when submitting start job for B also submit start job for A and fail start job for B if start job for A failed previously". Without After both start jobs are submitted concurrently; there is nothing to check when B is being started (as start job for A is not complete at this point) so there is no reason to fail start job for B.

Which was the reason to invent BindTo in the first place - as poor man simulation of what everyone thinks Requires does (while it does not do it).
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




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

  Powered by Linux