[systemd-devel] No error even a Required= service does not exist

Uoti Urpala uoti.urpala at pp1.inet.fi
Mon Nov 25 16:13:17 UTC 2019


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.




More information about the systemd-devel mailing list