]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/job.c
Fail RequisiteOf units with oneshots
authorJonathon Kowalski <bl0pbl33p@gmail.com>
Sat, 19 Jan 2019 05:19:46 +0000 (05:19 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 Feb 2019 12:42:54 +0000 (13:42 +0100)
commit791cd1599311d2cfffec9cc7d2915b36cbd3047d
tree949e20a13b284f1617a14f2a37f0d0b5fdff1584
parenta15ff62d767307cf7e0bbb65c7db6c05b1168d72
Fail RequisiteOf units with oneshots

Fixes: #11422
Oneshots going to inactive directly without ever entering UNIT_ACTIVE is
considered success. This however means that if something both Requires=
and Requisites= a unit of such nature, the verify-active job getting
merged into the start job makes it lose this property of failing the
depending jobs, as there, the start job has the result JOB_DONE on
success, so we never walk over RequisiteOf units.

This change makes sure that such units always go down. It is also only
meaningful with After=, but so is Requisite= itself. Also, we also catch
cases like a oneshot having RemainAfterExit= true making us start up
properly in such a setting, but then removing it, reloading the unit,
and restarting it. In such a case, we go down due to restart propagation
before them, and our start job waits on theirs, properly failing with
the JOB_DEPENDENCY result.

This covers cases where ConditionXYZ= creates a similar situation as
well.
src/core/job.c