[systemd-devel] No error even a Required= service does not exist
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Mon Nov 25 17:40:18 UTC 2019
On Mon, Nov 25, 2019 at 06:13:17PM +0200, Uoti Urpala wrote:
> On Mon, 2019-11-25 at 15:19 +0200, Mantas MikulÄ—nas wrote:
> > > 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.)
>
> No when there IS NOT an "After=xyz.service".
>
> Without "After=", there is no ordering dependency - it just tells that
> anything starting this unit will effectively order the start of the
> other as well. Without ordering, this unit can be the one to start
> first. If the other one fails to actually start later, that doesn't
> make systemd go back to stop this one (note that this is consistent
> with ordering dependencies - if a depended-on service fails later
> during runtime, that does not automatically force a stop of already
> running depending services). I guess this logic extends to failures of
> the "does not exist at all" type where there was never a chance of
> successfully starting the unit.
Sounds like a bug. I'd expect the transaction to fail if the Required
unit cannot be found.
Zbyszek
More information about the systemd-devel
mailing list